From 85e768c11fde72c56425ae3438c5d7dba820b8ab Mon Sep 17 00:00:00 2001 From: dominik Date: Tue, 25 Jan 2005 15:38:36 +0000 Subject: (svn r1667) - Feature: Signs are now shown in the color of the player who created them (Note: The player information is currently not stored in savegames. Upon loading a game the signs will all be gray again) --- ttd.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ttd.c') diff --git a/ttd.c b/ttd.c index 70e8e6722..f86c00e27 100644 --- a/ttd.c +++ b/ttd.c @@ -1269,6 +1269,15 @@ static void UpdateVoidTiles(void) memset(_map_type_and_height + MapMaxY() * MapSizeX(), MP_VOID << 4, MapSizeX()); } +// since savegame version 6.0 each sign has an "owner", signs without owner (from old games are set to 255) +static void UpdateSignOwner(void) +{ + SignStruct *ss; + FOR_ALL_SIGNS(ss) { + ss->owner = OWNER_NONE; // no owner + } +} + extern void UpdateOldAircraft( void ); extern void UpdateOilRig( void ); @@ -1292,6 +1301,11 @@ bool AfterLoadGame(uint version) UpdateCurrencies(); } + // from version 6.0 of the savegame, signs have an "owner" + if (version <= 0x600) { + UpdateSignOwner(); + } + /* In old version there seems to be a problem that water is owned by OWNER_NONE, not OWNER_WATER.. I can't replicate it for the current (0x402) version, so I just check when versions are older, and then -- cgit v1.2.3-54-g00ecf