Merge branch 'master' into jgrpp

This commit is contained in:
Jonathan G Rennison
2020-05-07 20:57:13 +01:00
83 changed files with 199 additions and 120 deletions

View File

@@ -1070,19 +1070,19 @@ bool AfterLoadGame()
break;
case STATION_OILRIG: {
/* The internal encoding of oil rigs was changed twice.
* It was 3 (till 2.2) and later 5 (till 5.1).
* DeleteOilRig asserts on the correct type, and
* setting it unconditionally does not hurt.
*/
Station::GetByTile(t)->airport.type = AT_OILRIG;
/* Very old savegames sometimes have phantom oil rigs, i.e.
* an oil rig which got shut down, but not completely removed from
* the map
*/
TileIndex t1 = TILE_ADDXY(t, 0, 1);
if (IsTileType(t1, MP_INDUSTRY) &&
GetIndustryGfx(t1) == GFX_OILRIG_1) {
/* The internal encoding of oil rigs was changed twice.
* It was 3 (till 2.2) and later 5 (till 5.1).
* Setting it unconditionally does not hurt.
*/
Station::GetByTile(t)->airport.type = AT_OILRIG;
} else {
if (!IsTileType(t1, MP_INDUSTRY) || GetIndustryGfx(t1) != GFX_OILRIG_1) {
DeleteOilRig(t);
}
break;
@@ -1400,6 +1400,7 @@ bool AfterLoadGame()
}
} else if (v->z_pos > GetSlopePixelZ(v->x_pos, v->y_pos)) {
v->tile = GetNorthernBridgeEnd(v->tile);
v->UpdatePosition();
} else {
continue;
}
@@ -2458,7 +2459,7 @@ bool AfterLoadGame()
}
if (remove) {
DeleteAnimatedTile(*tile);
tile = _animated_tiles.erase(tile);
} else {
tile++;
}
@@ -3664,8 +3665,14 @@ bool AfterLoadGame()
}
}
/* Update station docking tiles. */
AfterLoadScanDockingTiles();
if (IsSavegameVersionUntil(SLV_ENDING_YEAR) || !SlXvIsFeaturePresent(XSLFI_MULTIPLE_DOCKS, 2) || !SlXvIsFeaturePresent(XSLFI_DOCKING_CACHE_VER, 1)) {
/* Update station docking tiles. Was only needed for pre-SLV_MULTITLE_DOCKS
* savegames, but a bug in docking tiles touched all savegames between
* SLV_MULTITILE_DOCKS and SLV_ENDING_YEAR. */
for (Station *st : Station::Iterate()) {
if (st->ship_station.tile != INVALID_TILE) UpdateStationDockingTiles(st);
}
}
/* Compute station catchment areas. This is needed here in case UpdateStationAcceptance is called below. */
Station::RecomputeCatchmentForAll();