From 770f86bbbe89401ddae8518910a6875af65c0ac3 Mon Sep 17 00:00:00 2001 From: dominik Date: Mon, 23 Aug 2004 21:04:39 +0000 Subject: (svn r122) Change: exclusive transport rights are now stored per town instead of per station Exclusive rights from old savegames will be reset. --- ttd.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'ttd.c') diff --git a/ttd.c b/ttd.c index 8f6d281ef..33cd72fcc 100644 --- a/ttd.c +++ b/ttd.c @@ -1039,6 +1039,24 @@ void CheckIsPlayerActive() } } +// since savegame version 4.1, exclusive transport rights are stored at towns +void UpdateExclusiveRights() +{ + Town *t; + FOR_ALL_TOWNS(t) if (t->xy != 0) { + t->exclusivity=(byte)-1; + } + + /* FIXME old exclusive rights status is not being imported. + could be implemented this way: + 1.) Go through all stations + Build an array town_blocked[ town_id ][ player_id ] + that stores if at least one station in that town is blocked for a player + 2.) Go through that array, if you find a town that is not blocked for + one player, but for all others, then give him exclusivity. + */ +} + extern void UpdateOldAircraft(); bool AfterLoadGame(uint version) @@ -1051,6 +1069,11 @@ bool AfterLoadGame(uint version) ConvertTownOwner(); } + // from version 4.1 of the savegame, exclusive rights are stored at towns + if (version <= 0x400) { + UpdateExclusiveRights(); + } + // convert road side to my format. if (_opt.road_side) _opt.road_side = 1; -- cgit v1.2.3-54-g00ecf