diff options
author | rubidium <rubidium@openttd.org> | 2007-01-14 23:09:25 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-01-14 23:09:25 +0000 |
commit | 48611e1e209023259204df7796ae8e8778763266 (patch) | |
tree | 58ab7dbc323eddd8b8f1d4112bf2d62f10f42b19 | |
parent | cd74706c5409ab6c912618be25dfa6dcea7bbaf5 (diff) | |
download | openttd-48611e1e209023259204df7796ae8e8778763266.tar.xz |
(svn r8137) -Fix (FS#551, r4259, r4320): roadstop->num_vehicles was wrong for savegames with version 24 or lower and do not calculate roadstop->num_vehicles when reading the roadstops as the vehicles might not be loaded at that moment.
-rw-r--r-- | src/openttd.cpp | 5 | ||||
-rw-r--r-- | src/station_cmd.cpp | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index 10eb7f55e..e0d0d1f27 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1553,6 +1553,11 @@ bool AfterLoadGame(void) v->u.road.slot_age = 0; } } + } else { + Vehicle *v; + FOR_ALL_VEHICLES(v) { + if (v->type == VEH_Road && v->u.road.slot != NULL) v->u.road.slot->num_vehicles++; + } } if (CheckSavegameVersion(26)) { diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 7cef040c5..98a177d7d 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -3060,7 +3060,6 @@ static void Save_ROADSTOP(void) static void Load_ROADSTOP(void) { int index; - Vehicle *v; while ((index = SlIterateArray()) != -1) { RoadStop *rs; @@ -3071,10 +3070,6 @@ static void Load_ROADSTOP(void) rs = GetRoadStop(index); SlObject(rs, _roadstop_desc); } - - FOR_ALL_VEHICLES(v) { - if (v->type == VEH_Road && v->u.road.slot != NULL) v->u.road.slot->num_vehicles++; - } } extern const ChunkHandler _station_chunk_handlers[] = { |