Changeset - r14990:0208b1161624
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2010-04-11 21:46:20
rubidium@openttd.org
(svn r19612) -Fix [FS#3756] (r3212): crash when opening a savegame with a waypoint from around 0.4.0
1 file changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/saveload/waypoint_sl.cpp
Show inline comments
 
@@ -67,13 +67,18 @@ void MoveWaypointsToBaseStations()
 
	/* In version 17, ground type is moved from m2 to m4 for depots and
 
	 * waypoints to make way for storing the index in m2. The custom graphics
 
	 * id which was stored in m4 is now saved as a grf/id reference in the
 
	 * waypoint struct. */
 
	if (CheckSavegameVersion(17)) {
 
		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);
 
			}
 
		}
 
	} else {
 
		/* As of version 17, we recalculate the custom graphic ID of waypoints
 
		 * from the GRF ID / station index. */
0 comments (0 inline, 0 general)