mirror of https://github.com/OpenTTD/OpenTTD
(svn r21795) -Fix (r21790): when converting TTDPatch train waypoints, convert the data on the map as well
parent
75351f4043
commit
85255ea001
|
@ -2012,8 +2012,8 @@ bool AfterLoadGame()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsSavegameVersionBefore(124)) {
|
if (IsSavegameVersionBefore(124) && !IsSavegameVersionBefore(1)) {
|
||||||
/* The train station tile area was added */
|
/* The train station tile area was added, but for really old (TTDPatch) it's already valid. */
|
||||||
Waypoint *wp;
|
Waypoint *wp;
|
||||||
FOR_ALL_WAYPOINTS(wp) {
|
FOR_ALL_WAYPOINTS(wp) {
|
||||||
if (wp->facilities & FACIL_TRAIN) {
|
if (wp->facilities & FACIL_TRAIN) {
|
||||||
|
|
|
@ -70,6 +70,7 @@ void MoveBuoysToWaypoints()
|
||||||
Date build_date = st->build_date;
|
Date build_date = st->build_date;
|
||||||
/* TTDPatch could use "buoys with rail station" for rail waypoints */
|
/* TTDPatch could use "buoys with rail station" for rail waypoints */
|
||||||
bool train = st->train_station.tile != INVALID_TILE;
|
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 the station, so we can make it a real waypoint. */
|
||||||
delete st;
|
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 (IsInsideBS(string_id, STR_SV_STNAME_BUOY, 9)) wp->town_cn = string_id - STR_SV_STNAME_BUOY;
|
||||||
|
|
||||||
if (train) {
|
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;
|
wp->facilities |= FACIL_TRAIN;
|
||||||
} else if (IsBuoyTile(xy) && GetStationIndex(xy) == index) {
|
} else if (IsBuoyTile(xy) && GetStationIndex(xy) == index) {
|
||||||
|
wp->rect.BeforeAddTile(xy, StationRect::ADD_FORCE);
|
||||||
wp->facilities |= FACIL_DOCK;
|
wp->facilities |= FACIL_DOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
wp->rect.BeforeAddTile(xy, StationRect::ADD_FORCE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue