mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
(svn r14348) -Fix (r1667): signs were not updated on company bankrupcy/sell, they have colour of invalid player
This commit is contained in:
parent
94c5c9f21d
commit
74892fbdf6
@ -45,6 +45,7 @@
|
|||||||
#include "gfx_func.h"
|
#include "gfx_func.h"
|
||||||
#include "autoreplace_func.h"
|
#include "autoreplace_func.h"
|
||||||
#include "player_gui.h"
|
#include "player_gui.h"
|
||||||
|
#include "signs_base.h"
|
||||||
|
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
#include "table/sprites.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 */
|
/* Change color of existing windows */
|
||||||
if (new_player != PLAYER_SPECTATOR) ChangeWindowOwner(old_player, new_player);
|
if (new_player != PLAYER_SPECTATOR) ChangeWindowOwner(old_player, new_player);
|
||||||
|
|
||||||
|
@ -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);
|
GamelogPrintDebug(1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user