Add support for loading SpringPP savegame versions 221 and 222.
These correspond to versions from v2.1.108 and v2.1.147. The oil rig airport type bug is fixed as of version 221. The oil rig type has been moved, but this is not a problem as the afterload code already remaps it to the correct value. The cost scaling issue also seems to have been mostly fixed as of version 221.
This commit is contained in:
@@ -3057,10 +3057,10 @@ bool AfterLoadGame()
|
||||
}
|
||||
}
|
||||
|
||||
if (SlXvIsFeaturePresent(XSLFI_SPRINGPP)) {
|
||||
if (SlXvIsFeaturePresent(XSLFI_SPRINGPP, 1, 1)) {
|
||||
/*
|
||||
* Cost scaling changes:
|
||||
* SpringPP divides all prices by the difficulty factor, effectively making things about 8 times cheaper.
|
||||
* SpringPP v2.0.102 divides all prices by the difficulty factor, effectively making things about 8 times cheaper.
|
||||
* Adjust the inflation factor to compensate for this, as otherwise the game is unplayable on load if inflation has been running for a while.
|
||||
* To avoid making things too cheap, clamp the price inflation factor to no lower than the payment inflation factor.
|
||||
*/
|
||||
@@ -3078,8 +3078,8 @@ bool AfterLoadGame()
|
||||
|
||||
if (SlXvIsFeaturePresent(XSLFI_SPRINGPP)) {
|
||||
/*
|
||||
* Reject huge airports and helicopters aproaching oil rigs using the wrong aircraft movement data
|
||||
* Annoyingly SpringPP has a bug where it uses the same ID for AT_INTERCONTINENTAL2 and AT_OILRIG
|
||||
* Reject huge airports
|
||||
* Annoyingly SpringPP v2.0.102 has a bug where it uses the same ID for AT_INTERCONTINENTAL2 and AT_OILRIG,
|
||||
*/
|
||||
Station *st;
|
||||
FOR_ALL_STATIONS(st) {
|
||||
@@ -3102,6 +3102,12 @@ bool AfterLoadGame()
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (SlXvIsFeaturePresent(XSLFI_SPRINGPP, 1, 1)) {
|
||||
/*
|
||||
* Reject helicopters aproaching oil rigs using the wrong aircraft movement data
|
||||
* Annoyingly SpringPP v2.0.102 has a bug where it uses the same ID for AT_INTERCONTINENTAL2 and AT_OILRIG
|
||||
*/
|
||||
Aircraft *v;
|
||||
FOR_ALL_AIRCRAFT(v) {
|
||||
Station *st = GetTargetAirportIfValid(v);
|
||||
|
@@ -144,6 +144,20 @@ void SlXvCheckSpecialSavegameVersions()
|
||||
DEBUG(sl, 1, "Loading a SpringPP 2013 v2.0.102 savegame version %d as version 187", _sl_version);
|
||||
|
||||
_sl_version = 187;
|
||||
_sl_xv_feature_versions[XSLFI_SPRINGPP] = 1;
|
||||
} else if (_sl_version == 221) { /* SL_SPRING_2013_v2_1_108 */
|
||||
DEBUG(sl, 1, "Loading a SpringPP 2013 v2.1.108 savegame version %d as version 188", _sl_version);
|
||||
|
||||
_sl_version = 188;
|
||||
_sl_xv_feature_versions[XSLFI_SPRINGPP] = 2;
|
||||
} else if (_sl_version == 222) { /* SL_SPRING_2013_v2_1_147 */
|
||||
DEBUG(sl, 1, "Loading a SpringPP 2013 v2.1.147 savegame version %d as version 194", _sl_version);
|
||||
|
||||
_sl_version = 194;
|
||||
_sl_xv_feature_versions[XSLFI_SPRINGPP] = 3;
|
||||
}
|
||||
|
||||
if (_sl_xv_feature_versions[XSLFI_SPRINGPP]) {
|
||||
_sl_xv_feature_versions[XSLFI_RIFF_HEADER_60_BIT] = 1;
|
||||
_sl_xv_feature_versions[XSLFI_HEIGHT_8_BIT] = 1;
|
||||
_sl_xv_feature_versions[XSLFI_MIGHT_USE_PAX_SIGNALS] = 1;
|
||||
@@ -154,8 +168,6 @@ void SlXvCheckSpecialSavegameVersions()
|
||||
_sl_xv_feature_versions[XSLFI_INFRA_SHARING] = 1;
|
||||
_sl_xv_feature_versions[XSLFI_AUTO_TIMETABLE] = 1;
|
||||
|
||||
_sl_xv_feature_versions[XSLFI_SPRINGPP] = 1;
|
||||
|
||||
_sl_xv_discardable_chunk_ids.push_back('SNOW');
|
||||
}
|
||||
}
|
||||
|
@@ -190,7 +190,8 @@ static const SaveLoad _old_station_desc[] = {
|
||||
|
||||
SLE_VAR(Station, time_since_load, SLE_UINT8),
|
||||
SLE_VAR(Station, time_since_unload, SLE_UINT8),
|
||||
SLE_VAR(Station, delete_ctr, SLE_UINT8),
|
||||
SLE_CONDVAR_X(Station, delete_ctr, SLE_UINT8, 0, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP, 0, 2)),
|
||||
SLE_CONDVAR_X(Station, delete_ctr, SLE_FILE_U16 | SLE_VAR_U8, 0, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP, 3)),
|
||||
SLE_VAR(Station, owner, SLE_UINT8),
|
||||
SLE_VAR(Station, facilities, SLE_UINT8),
|
||||
SLE_VAR(Station, airport.type, SLE_UINT8),
|
||||
@@ -270,6 +271,7 @@ const SaveLoad *GetGoodsDesc()
|
||||
SLE_CONDVAR(GoodsEntry, status, SLE_UINT8, 68, SL_MAX_VERSION),
|
||||
SLE_CONDNULL(2, 51, 67),
|
||||
SLE_VAR(GoodsEntry, time_since_pickup, SLE_UINT8),
|
||||
SLE_CONDNULL_X(6, 0, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP, 3)),
|
||||
SLE_VAR(GoodsEntry, rating, SLE_UINT8),
|
||||
SLEG_CONDVAR( _cargo_source, SLE_FILE_U8 | SLE_VAR_U16, 0, 6),
|
||||
SLEG_CONDVAR( _cargo_source, SLE_UINT16, 7, 67),
|
||||
@@ -393,7 +395,8 @@ static const SaveLoad _base_station_desc[] = {
|
||||
SLE_REF(BaseStation, town, REF_TOWN),
|
||||
SLE_VAR(BaseStation, string_id, SLE_STRINGID),
|
||||
SLE_STR(BaseStation, name, SLE_STR | SLF_ALLOW_CONTROL, 0),
|
||||
SLE_VAR(BaseStation, delete_ctr, SLE_UINT8),
|
||||
SLE_CONDVAR_X(Station, delete_ctr, SLE_UINT8, 0, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP, 0, 2)),
|
||||
SLE_CONDVAR_X(Station, delete_ctr, SLE_FILE_U16 | SLE_VAR_U8, 0, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP, 3)),
|
||||
SLE_VAR(BaseStation, owner, SLE_UINT8),
|
||||
SLE_VAR(BaseStation, facilities, SLE_UINT8),
|
||||
SLE_VAR(BaseStation, build_date, SLE_INT32),
|
||||
|
@@ -645,7 +645,8 @@ const SaveLoad *GetVehicleDescription(VehicleType vt)
|
||||
|
||||
SLE_VAR(Vehicle, day_counter, SLE_UINT8),
|
||||
SLE_VAR(Vehicle, tick_counter, SLE_UINT8),
|
||||
SLE_CONDVAR(Vehicle, running_ticks, SLE_UINT8, 88, SL_MAX_VERSION),
|
||||
SLE_CONDVAR_X(Vehicle, running_ticks, SLE_UINT8, 88, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP, 0, 2)),
|
||||
SLE_CONDVAR_X(Vehicle, running_ticks, SLE_FILE_U16 | SLE_VAR_U8, 88, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP, 2)),
|
||||
|
||||
SLE_VAR(Vehicle, cur_implicit_order_index, SLE_UINT8),
|
||||
SLE_CONDVAR(Vehicle, cur_real_order_index, SLE_UINT8, 158, SL_MAX_VERSION),
|
||||
@@ -732,6 +733,7 @@ const SaveLoad *GetVehicleDescription(VehicleType vt)
|
||||
SLE_CONDNULL(10, 2, 143), // old reserved space
|
||||
|
||||
SLE_CONDNULL_X((8 + 8 + 2 + 2 + 4 + 4 + 1 + 1) * 30, 0, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP)),
|
||||
SLE_CONDNULL_X((8 + 8 + 2 + 2 + 4 + 4 + 1 + 1) * 70, 0, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP, 3)),
|
||||
SLE_CONDNULL_X(1, 0, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP)),
|
||||
SLE_CONDNULL_X(1, 0, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP)),
|
||||
SLE_CONDNULL_X(2, 0, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP)),
|
||||
|
@@ -74,6 +74,11 @@ base = CompanySettings
|
||||
var = renew_keep_length
|
||||
def = false
|
||||
|
||||
;; allow_autoreplace_to_self
|
||||
[SDT_NULL]
|
||||
length = 1
|
||||
extver = SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP, 2)
|
||||
|
||||
[SDT_BOOL]
|
||||
base = CompanySettings
|
||||
var = vehicle.servint_ispercent
|
||||
|
@@ -564,6 +564,10 @@ str = STR_CONFIG_SETTING_MAX_BRIDGE_LENGTH
|
||||
strhelp = STR_CONFIG_SETTING_MAX_BRIDGE_LENGTH_HELPTEXT
|
||||
strval = STR_CONFIG_SETTING_TILE_LENGTH
|
||||
|
||||
[SDT_XREF]
|
||||
extver = SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP, 2)
|
||||
xref = ""construction.simulated_wormhole_signals""
|
||||
|
||||
[SDT_VAR]
|
||||
base = GameSettings
|
||||
var = construction.max_bridge_height
|
||||
@@ -1446,6 +1450,11 @@ def = false
|
||||
str = STR_CONFIG_SETTING_MULTIPINDTOWN
|
||||
strhelp = STR_CONFIG_SETTING_MULTIPINDTOWN_HELPTEXT
|
||||
|
||||
;; economy.allow_automatic_industries
|
||||
[SDT_NULL]
|
||||
length = 1
|
||||
extver = SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP, 3)
|
||||
|
||||
[SDT_NULL]
|
||||
length = 1
|
||||
to = 140
|
||||
@@ -1587,6 +1596,7 @@ extver = SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP)
|
||||
length = 16
|
||||
extver = SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP)
|
||||
|
||||
; note that this has changed format in SpringPP 2.1.147
|
||||
[SDT_XREF]
|
||||
xref = ""vehicle.pay_for_repair""
|
||||
extver = SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP)
|
||||
|
Reference in New Issue
Block a user