diff options
author | rubidium <rubidium@openttd.org> | 2010-11-20 09:09:57 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-11-20 09:09:57 +0000 |
commit | 097880c5e221fc3d6f59383e30753ac728c9439f (patch) | |
tree | f6b551c4503df8c3407b1c4a0c6e3055d47b204e /src/saveload | |
parent | f80af8f8c8c2cbb3ce97d801f45959b855d2abdc (diff) | |
download | openttd-097880c5e221fc3d6f59383e30753ac728c9439f.tar.xz |
(svn r21263) -Fix [FS#3935]: under some circumstances two vehicles could leave a non-drive through road stop at once
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/afterload.cpp | 13 | ||||
-rw-r--r-- | src/saveload/saveload.cpp | 3 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 7ed394d20..1b5b437aa 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -2377,6 +2377,19 @@ bool AfterLoadGame() } } + if (CheckSavegameVersion(153)) { + RoadVehicle *rv; + FOR_ALL_ROADVEHICLES(rv) { + bool loading = rv->current_order.IsType(OT_LOADING) || rv->current_order.IsType(OT_LEAVESTATION); + if (HasBit(rv->state, RVS_IN_ROAD_STOP)) { + extern const byte _road_stop_stop_frame[]; + SB(rv->state, RVS_ENTERED_STOP, 1, loading || rv->frame > _road_stop_stop_frame[rv->state - RVSB_IN_ROAD_STOP + (_settings_game.vehicle.road_side << RVS_DRIVE_SIDE)]); + } else if (HasBit(rv->state, RVS_IN_DT_ROAD_STOP)) { + SB(rv->state, RVS_ENTERED_STOP, 1, loading || rv->frame > RVC_DRIVE_THROUGH_STOP_FRAME); + } + } + } + /* Road stops is 'only' updating some caches */ AfterLoadRoadStops(); AfterLoadLabelMaps(); diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index ba7819a55..c84d69bfc 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -215,8 +215,9 @@ * 150 20857 * 151 20918 * 152 21171 + * 153 21263 */ -extern const uint16 SAVEGAME_VERSION = 152; ///< Current savegame version of OpenTTD. +extern const uint16 SAVEGAME_VERSION = 153; ///< Current savegame version of OpenTTD. SavegameType _savegame_type; ///< type of savegame we are loading |