Update multiple docks to use savegame framework, fix merge conflicts
This commit is contained in:
@@ -878,7 +878,7 @@ bool AfterLoadGame()
|
|||||||
if (st->airport.tile == INVALID_TILE) continue;
|
if (st->airport.tile == INVALID_TILE) continue;
|
||||||
StringID err = INVALID_STRING_ID;
|
StringID err = INVALID_STRING_ID;
|
||||||
if (st->airport.type == 9) {
|
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 */
|
/* this airport is probably an oil rig, not a huge airport */
|
||||||
} else {
|
} else {
|
||||||
err = STR_GAME_SAVELOAD_ERROR_HUGE_AIRPORTS_PRESENT;
|
err = STR_GAME_SAVELOAD_ERROR_HUGE_AIRPORTS_PRESENT;
|
||||||
@@ -905,7 +905,7 @@ bool AfterLoadGame()
|
|||||||
Aircraft *v;
|
Aircraft *v;
|
||||||
FOR_ALL_AIRCRAFT(v) {
|
FOR_ALL_AIRCRAFT(v) {
|
||||||
Station *st = GetTargetAirportIfValid(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 */
|
/* aircraft is on approach to an oil rig, bail out now */
|
||||||
SetSaveLoadError(STR_GAME_SAVELOAD_ERROR_HELI_OILRIG_BUG);
|
SetSaveLoadError(STR_GAME_SAVELOAD_ERROR_HELI_OILRIG_BUG);
|
||||||
/* Restore the signals */
|
/* 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. */
|
/* Dock type has changed. */
|
||||||
Station *st;
|
Station *st;
|
||||||
FOR_ALL_STATIONS(st) {
|
FOR_ALL_STATIONS(st) {
|
||||||
|
@@ -78,6 +78,7 @@ const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = {
|
|||||||
{ XSLFI_CHUNNEL, XSCF_NULL, 1, 1, "chunnel", NULL, NULL, "TUNN" },
|
{ XSLFI_CHUNNEL, XSCF_NULL, 1, 1, "chunnel", NULL, NULL, "TUNN" },
|
||||||
{ XSLFI_SCHEDULED_DISPATCH, XSCF_NULL, 1, 1, "scheduled_dispatch", NULL, NULL, NULL },
|
{ 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_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
|
{ XSLFI_NULL, XSCF_NULL, 0, 0, NULL, NULL, NULL, NULL },// This is the end marker
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -52,6 +52,7 @@ enum SlXvFeatureIndex {
|
|||||||
XSLFI_CHUNNEL, ///< Tunnels under water (channel tunnel)
|
XSLFI_CHUNNEL, ///< Tunnels under water (channel tunnel)
|
||||||
XSLFI_SCHEDULED_DISPATCH, ///< Scheduled vehicle dispatching
|
XSLFI_SCHEDULED_DISPATCH, ///< Scheduled vehicle dispatching
|
||||||
XSLFI_MORE_TOWN_GROWTH_RATES, ///< More town growth rates
|
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_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
|
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
|
||||||
|
@@ -439,8 +439,8 @@ static const SaveLoad _station_desc[] = {
|
|||||||
|
|
||||||
SLE_REF(Station, bus_stops, REF_ROADSTOPS),
|
SLE_REF(Station, bus_stops, REF_ROADSTOPS),
|
||||||
SLE_REF(Station, truck_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_CONDVAR_X(Station, dock_station.tile, SLE_UINT32, 0, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_MULTIPLE_DOCKS, 0, 0)),
|
||||||
SLE_CONDREF(Station, docks, REF_DOCKS, SL_PATCH_PACK_1_18, SL_MAX_VERSION),
|
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_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.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),
|
SLE_CONDVAR(Station, airport.h, SLE_FILE_U8 | SLE_VAR_U16, 140, SL_MAX_VERSION),
|
||||||
|
@@ -2714,9 +2714,6 @@ static CommandCost RemoveDock(TileIndex tile, DoCommandFlag flags)
|
|||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
ZoningMarkDirtyStationCoverageArea(st);
|
ZoningMarkDirtyStationCoverageArea(st);
|
||||||
|
|
||||||
st->catchment.AfterRemoveTile(tile1, CA_DOCK);
|
|
||||||
st->catchment.AfterRemoveTile(tile2, CA_DOCK);
|
|
||||||
|
|
||||||
if (st->docks == removing_dock) {
|
if (st->docks == removing_dock) {
|
||||||
/* The first dock in the list is removed. */
|
/* The first dock in the list is removed. */
|
||||||
st->docks = removing_dock->next;
|
st->docks = removing_dock->next;
|
||||||
|
Reference in New Issue
Block a user