summaryrefslogtreecommitdiff
path: root/src/saveload/station_sl.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-01-14 20:52:22 +0000
committerrubidium <rubidium@openttd.org>2011-01-14 20:52:22 +0000
commit85255ea001c975602c5129911b108c03db848471 (patch)
tree4496508995264968ae82ab0b827eb2b2af4fb0b4 /src/saveload/station_sl.cpp
parent75351f4043c8ead164a79c43683b64fd9a3d3ad3 (diff)
downloadopenttd-85255ea001c975602c5129911b108c03db848471.tar.xz
(svn r21795) -Fix (r21790): when converting TTDPatch train waypoints, convert the data on the map as well
Diffstat (limited to 'src/saveload/station_sl.cpp')
-rw-r--r--src/saveload/station_sl.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp
index 8074040ee..b0535d9d2 100644
--- a/src/saveload/station_sl.cpp
+++ b/src/saveload/station_sl.cpp
@@ -70,6 +70,7 @@ void MoveBuoysToWaypoints()
Date build_date = st->build_date;
/* TTDPatch could use "buoys with rail station" for rail waypoints */
bool train = st->train_station.tile != INVALID_TILE;
+ TileArea train_st = st->train_station;
/* Delete the station, so we can make it a real waypoint. */
delete st;
@@ -85,12 +86,20 @@ void MoveBuoysToWaypoints()
if (IsInsideBS(string_id, STR_SV_STNAME_BUOY, 9)) wp->town_cn = string_id - STR_SV_STNAME_BUOY;
if (train) {
+ /* When we make a rail waypoint of the station, convert the map as well. */
+ TILE_AREA_LOOP(t, train_st) {
+ if (!IsTileType(t, MP_STATION) || GetStationIndex(t) != index) continue;
+
+ SB(_m[t].m6, 3, 3, STATION_WAYPOINT);
+ wp->rect.BeforeAddTile(t, StationRect::ADD_FORCE);
+ }
+
+ wp->train_station = train_st;
wp->facilities |= FACIL_TRAIN;
} else if (IsBuoyTile(xy) && GetStationIndex(xy) == index) {
+ wp->rect.BeforeAddTile(xy, StationRect::ADD_FORCE);
wp->facilities |= FACIL_DOCK;
}
-
- wp->rect.BeforeAddTile(xy, StationRect::ADD_FORCE);
}
}