Update multiple docks to use savegame framework, fix merge conflicts

This commit is contained in:
Jonathan G Rennison
2017-09-20 19:50:53 +01:00
parent 06abeb4570
commit be37aad470
5 changed files with 7 additions and 8 deletions

View File

@@ -878,7 +878,7 @@ bool AfterLoadGame()
if (st->airport.tile == INVALID_TILE) continue;
StringID err = INVALID_STRING_ID;
if (st->airport.type == 9) {
if (st->dock_tile != INVALID_TILE && IsOilRig(st->dock_tile)) {
if (st->dock_station.tile != INVALID_TILE && IsOilRig(st->dock_station.tile)) {
/* this airport is probably an oil rig, not a huge airport */
} else {
err = STR_GAME_SAVELOAD_ERROR_HUGE_AIRPORTS_PRESENT;
@@ -905,7 +905,7 @@ bool AfterLoadGame()
Aircraft *v;
FOR_ALL_AIRCRAFT(v) {
Station *st = GetTargetAirportIfValid(v);
if (st != NULL && ((st->dock_tile != INVALID_TILE && IsOilRig(st->dock_tile)) || st->airport.type == AT_OILRIG)) {
if (st != NULL && ((st->dock_station.tile != INVALID_TILE && IsOilRig(st->dock_station.tile)) || st->airport.type == AT_OILRIG)) {
/* aircraft is on approach to an oil rig, bail out now */
SetSaveLoadError(STR_GAME_SAVELOAD_ERROR_HELI_OILRIG_BUG);
/* Restore the signals */
@@ -1016,7 +1016,7 @@ bool AfterLoadGame()
}
}
if (IsPatchPackSavegameVersionBefore(SL_PATCH_PACK_1_18)) {
if (SlXvIsFeatureMissing(XSLFI_MULTIPLE_DOCKS)) {
/* Dock type has changed. */
Station *st;
FOR_ALL_STATIONS(st) {

View File

@@ -78,6 +78,7 @@ const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = {
{ XSLFI_CHUNNEL, XSCF_NULL, 1, 1, "chunnel", NULL, NULL, "TUNN" },
{ XSLFI_SCHEDULED_DISPATCH, XSCF_NULL, 1, 1, "scheduled_dispatch", NULL, NULL, NULL },
{ XSLFI_MORE_TOWN_GROWTH_RATES, XSCF_NULL, 1, 1, "more_town_growth_rates", NULL, NULL, NULL },
{ XSLFI_MULTIPLE_DOCKS, XSCF_NULL, 1, 1, "multiple_docks", NULL, NULL, "DOCK" },
{ XSLFI_NULL, XSCF_NULL, 0, 0, NULL, NULL, NULL, NULL },// This is the end marker
};

View File

@@ -52,6 +52,7 @@ enum SlXvFeatureIndex {
XSLFI_CHUNNEL, ///< Tunnels under water (channel tunnel)
XSLFI_SCHEDULED_DISPATCH, ///< Scheduled vehicle dispatching
XSLFI_MORE_TOWN_GROWTH_RATES, ///< More town growth rates
XSLFI_MULTIPLE_DOCKS, ///< Multiple docks
XSLFI_RIFF_HEADER_60_BIT, ///< Size field in RIFF chunk header is 60 bit
XSLFI_HEIGHT_8_BIT, ///< Map tile height is 8 bit instead of 4 bit, but savegame version may be before this became true in trunk

View File

@@ -439,8 +439,8 @@ static const SaveLoad _station_desc[] = {
SLE_REF(Station, bus_stops, REF_ROADSTOPS),
SLE_REF(Station, truck_stops, REF_ROADSTOPS),
SLE_CONDVAR(Station, dock_station.tile, SLE_UINT32, 0, SL_PATCH_PACK_1_18 - 1),
SLE_CONDREF(Station, docks, REF_DOCKS, SL_PATCH_PACK_1_18, SL_MAX_VERSION),
SLE_CONDVAR_X(Station, dock_station.tile, SLE_UINT32, 0, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_MULTIPLE_DOCKS, 0, 0)),
SLE_CONDREF_X(Station, docks, REF_DOCKS, 0, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_MULTIPLE_DOCKS, 1)),
SLE_VAR(Station, airport.tile, SLE_UINT32),
SLE_CONDVAR(Station, airport.w, SLE_FILE_U8 | SLE_VAR_U16, 140, SL_MAX_VERSION),
SLE_CONDVAR(Station, airport.h, SLE_FILE_U8 | SLE_VAR_U16, 140, SL_MAX_VERSION),

View File

@@ -2714,9 +2714,6 @@ static CommandCost RemoveDock(TileIndex tile, DoCommandFlag flags)
if (flags & DC_EXEC) {
ZoningMarkDirtyStationCoverageArea(st);
st->catchment.AfterRemoveTile(tile1, CA_DOCK);
st->catchment.AfterRemoveTile(tile2, CA_DOCK);
if (st->docks == removing_dock) {
/* The first dock in the list is removed. */
st->docks = removing_dock->next;