summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2007-02-21 07:37:31 +0000
committertron <tron@openttd.org>2007-02-21 07:37:31 +0000
commit565da62355f8f525f8d2cd1247e0094586d831e6 (patch)
treeddbaba035eff5c7aac47ae3f4cdcf397b9936775
parent771932d8891e9f1e52b957958c97511317c36055 (diff)
downloadopenttd-565da62355f8f525f8d2cd1247e0094586d831e6.tar.xz
(svn r8828) -Fix
-Regression (r7585): On load calculate the station rectangle for all savegames, not just savegames with at least version 27
-rw-r--r--src/openttd.cpp14
-rw-r--r--src/station_cmd.cpp5
2 files changed, 9 insertions, 10 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 724590a7c..3a8b10df6 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1288,20 +1288,23 @@ bool AfterLoadGame(void)
DoZoomInOutWindow(ZOOM_NONE, w); // update button status
MarkWholeScreenDirty();
- /* From this version on there can be multiple road stops of the same type per
- * station. Convert the existing stops to the new internal data structure.
- */
for (TileIndex t = 0; t < map_size; t++) {
switch (GetTileType(t)) {
- case MP_STATION:
+ case MP_STATION: {
+ Station *st = GetStationByTile(t);
+
+ st->rect.BeforeAddTile(t, StationRect::ADD_FORCE);
+
switch (GetStationType(t)) {
case STATION_TRUCK:
case STATION_BUS:
if (CheckSavegameVersion(6)) {
+ /* From this version on there can be multiple road stops of the
+ * same type per station. Convert the existing stops to the new
+ * internal data structure. */
RoadStop *rs = new RoadStop(t);
if (rs == NULL) error("Too many road stops in savegame");
- Station *st = GetStationByTile(t);
RoadStop **head =
IsTruckStop(t) ? &st->truck_stops : &st->bus_stops;
*head = rs;
@@ -1330,6 +1333,7 @@ bool AfterLoadGame(void)
default: break;
}
break;
+ }
default: break;
}
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index cd674d2d5..eb11ed5cb 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2647,11 +2647,6 @@ void AfterLoadStations(void)
st->speclist[i].spec = GetCustomStationSpecByGrf(st->speclist[i].grfid, st->speclist[i].localidx);
}
}
-
- for (TileIndex tile = 0; tile < MapSize(); tile++) {
- if (GetTileType(tile) != MP_STATION) continue;
- GetStationByTile(tile)->rect.BeforeAddTile(tile, StationRect::ADD_FORCE);
- }
}