diff options
author | dominik <dominik@openttd.org> | 2004-08-23 21:04:39 +0000 |
---|---|---|
committer | dominik <dominik@openttd.org> | 2004-08-23 21:04:39 +0000 |
commit | 770f86bbbe89401ddae8518910a6875af65c0ac3 (patch) | |
tree | d6c03495cca54829908bbe695956a762e7f6a6ef /ttd.c | |
parent | 1d1d14ebd3e4d85683f61d120944646864cebe4f (diff) | |
download | openttd-770f86bbbe89401ddae8518910a6875af65c0ac3.tar.xz |
(svn r122) Change: exclusive transport rights are now stored per town instead of per station
Exclusive rights from old savegames will be reset.
Diffstat (limited to 'ttd.c')
-rw-r--r-- | ttd.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -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; |