Changeset - r24174:493f00d11e30
[Not reviewed]
master
0 2 0
Yexo - 4 years ago 2020-05-04 21:58:56
yexo@openttd.org
Fix: reset roadtype/streetcartype info for non-road bridges
2 files changed with 21 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/saveload/afterload.cpp
Show inline comments
 
@@ -3116,12 +3116,20 @@ bool AfterLoadGame()
 
			if (IsTileType(t, MP_STATION)) {
 
				if (IsDock(t) || IsOilRig(t)) Station::GetByTile(t)->ship_station.Add(t);
 
			}
 
		}
 
	}
 

	
 
	if (IsSavegameVersionUntil(SLV_ENDING_YEAR)) {
 
		for (TileIndex t = 0; t < map_size; t++) {
 
			if (IsTileType(t, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(t) != TRANSPORT_ROAD) {
 
				SetRoadTypes(t, INVALID_ROADTYPE, INVALID_ROADTYPE);
 
			}
 
		}
 
	}
 

	
 
	/* Update station docking tiles. */
 
	AfterLoadScanDockingTiles();
 

	
 
	/* Compute station catchment areas. This is needed here in case UpdateStationAcceptance is called below. */
 
	Station::RecomputeCatchmentForAll();
 

	
src/saveload/saveload.h
Show inline comments
 
@@ -767,12 +767,25 @@ static inline bool IsSavegameVersionBefo
 
	extern SaveLoadVersion _sl_version;
 
	extern byte            _sl_minor_version;
 
	return _sl_version < major || (minor > 0 && _sl_version == major && _sl_minor_version < minor);
 
}
 

	
 
/**
 
 * Checks whether the savegame is below or at \a major. This should be used to repair data from existing
 
 * savegames which is no longer corrupted in new savegames, but for which otherwise no savegame
 
 * bump is required.
 
 * @param major Major number of the version to check against.
 
 * @return Savegame version is at most the specified version.
 
 */
 
static inline bool IsSavegameVersionUntil(SaveLoadVersion major)
 
{
 
	extern SaveLoadVersion _sl_version;
 
	return _sl_version <= major;
 
}
 

	
 
/**
 
 * Checks if some version from/to combination falls within the range of the
 
 * active savegame version.
 
 * @param version_from Inclusive savegame version lower bound.
 
 * @param version_to   Exclusive savegame version upper bound. SL_MAX_VERSION if no upper bound.
 
 * @return Active savegame version falls within the given range.
 
 */
0 comments (0 inline, 0 general)