mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-03 21:06:58 +00:00
(svn r19612) -Fix [FS#3756] (r3212): crash when opening a savegame with a waypoint from around 0.4.0
This commit is contained in:
parent
cef89b4f91
commit
7590651aea
@ -70,7 +70,12 @@ void MoveWaypointsToBaseStations()
|
|||||||
* waypoint struct. */
|
* waypoint struct. */
|
||||||
if (CheckSavegameVersion(17)) {
|
if (CheckSavegameVersion(17)) {
|
||||||
for (OldWaypoint *wp = _old_waypoints.Begin(); wp != _old_waypoints.End(); wp++) {
|
for (OldWaypoint *wp = _old_waypoints.Begin(); wp != _old_waypoints.End(); wp++) {
|
||||||
if (wp->delete_ctr == 0 && HasBit(_m[wp->xy].m3, 4)) {
|
if (wp->delete_ctr != 0) continue; // The waypoint was deleted
|
||||||
|
|
||||||
|
/* Waypoint indices were not added to the map prior to this. */
|
||||||
|
_m[wp->xy].m2 = wp->index;
|
||||||
|
|
||||||
|
if (HasBit(_m[wp->xy].m3, 4)) {
|
||||||
wp->spec = GetCustomStationSpec(STAT_CLASS_WAYP, _m[wp->xy].m4 + 1);
|
wp->spec = GetCustomStationSpec(STAT_CLASS_WAYP, _m[wp->xy].m4 + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user