diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/economy.cpp | 6 | ||||
-rw-r--r-- | src/openttd.cpp | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/economy.cpp b/src/economy.cpp index a80ea602d..8629fc270 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -45,6 +45,7 @@ #include "gfx_func.h" #include "autoreplace_func.h" #include "player_gui.h" +#include "signs_base.h" #include "table/strings.h" #include "table/sprites.h" @@ -467,6 +468,11 @@ void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player) } } + Sign *si; + FOR_ALL_SIGNS(si) { + if (si->owner == old_player) si->owner = new_player == PLAYER_SPECTATOR ? OWNER_NONE : new_player; + } + /* Change color of existing windows */ if (new_player != PLAYER_SPECTATOR) ChangeWindowOwner(old_player, new_player); diff --git a/src/openttd.cpp b/src/openttd.cpp index 23c2b81ce..1b690e2a2 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -2560,6 +2560,13 @@ bool AfterLoadGame() } } + if (CheckSavegameVersion(103)) { + /* signs with invalid owner left from older savegames */ + Sign *si; + FOR_ALL_SIGNS(si) { + if (si->owner != OWNER_NONE && !IsValidPlayerID(si->owner)) si->owner = OWNER_NONE; + } + } GamelogPrintDebug(1); |