summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorTyler Trahan <tyler@tylertrahan.com>2021-04-22 13:54:32 -0400
committerMichael Lutz <michi@icosahedron.de>2021-06-10 23:26:16 +0200
commitd09210e1c6a446ec5a97de4e171aa101d047765a (patch)
treed45a31e2b65f3399888e14524b805b15ef94a90f /src/saveload
parentc2db408d5d947cd4f3df42754a598226818c519f (diff)
downloadopenttd-d09210e1c6a446ec5a97de4e171aa101d047765a.tar.xz
Feature: Configurable subsidy duration
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/saveload.h1
-rw-r--r--src/saveload/subsidy_sl.cpp17
2 files changed, 10 insertions, 8 deletions
diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h
index 3a2427c93..28af1fd37 100644
--- a/src/saveload/saveload.h
+++ b/src/saveload/saveload.h
@@ -328,6 +328,7 @@ enum SaveLoadVersion : uint16 {
SLV_INDUSTRY_TEXT, ///< 289 PR#8576 v1.11.0-RC1 Additional GS text for industries.
SLV_MAPGEN_SETTINGS_REVAMP, ///< 290 PR#8891 v1.11 Revamp of some mapgen settings (snow coverage, desert coverage, heightmap height, custom terrain type).
SLV_GROUP_REPLACE_WAGON_REMOVAL, ///< 291 PR#7441 Per-group wagon removal flag.
+ SLV_CUSTOM_SUBSIDY_DURATION, ///< 292 PR#9081 Configurable subsidy duration.
SL_MAX_VERSION, ///< Highest possible saveload version
};
diff --git a/src/saveload/subsidy_sl.cpp b/src/saveload/subsidy_sl.cpp
index b17ae1f25..9ed65a04e 100644
--- a/src/saveload/subsidy_sl.cpp
+++ b/src/saveload/subsidy_sl.cpp
@@ -16,14 +16,15 @@
static const SaveLoad _subsidies_desc[] = {
SLE_VAR(Subsidy, cargo_type, SLE_UINT8),
- SLE_VAR(Subsidy, remaining, SLE_UINT8),
- SLE_CONDVAR(Subsidy, awarded, SLE_UINT8, SLV_125, SL_MAX_VERSION),
- SLE_CONDVAR(Subsidy, src_type, SLE_UINT8, SLV_125, SL_MAX_VERSION),
- SLE_CONDVAR(Subsidy, dst_type, SLE_UINT8, SLV_125, SL_MAX_VERSION),
- SLE_CONDVAR(Subsidy, src, SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_5),
- SLE_CONDVAR(Subsidy, src, SLE_UINT16, SLV_5, SL_MAX_VERSION),
- SLE_CONDVAR(Subsidy, dst, SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_5),
- SLE_CONDVAR(Subsidy, dst, SLE_UINT16, SLV_5, SL_MAX_VERSION),
+ SLE_CONDVAR(Subsidy, remaining, SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_CUSTOM_SUBSIDY_DURATION),
+ SLE_CONDVAR(Subsidy, remaining, SLE_UINT16, SLV_CUSTOM_SUBSIDY_DURATION, SL_MAX_VERSION),
+ SLE_CONDVAR(Subsidy, awarded, SLE_UINT8, SLV_125, SL_MAX_VERSION),
+ SLE_CONDVAR(Subsidy, src_type, SLE_UINT8, SLV_125, SL_MAX_VERSION),
+ SLE_CONDVAR(Subsidy, dst_type, SLE_UINT8, SLV_125, SL_MAX_VERSION),
+ SLE_CONDVAR(Subsidy, src, SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_5),
+ SLE_CONDVAR(Subsidy, src, SLE_UINT16, SLV_5, SL_MAX_VERSION),
+ SLE_CONDVAR(Subsidy, dst, SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_5),
+ SLE_CONDVAR(Subsidy, dst, SLE_UINT16, SLV_5, SL_MAX_VERSION),
};
static void Save_SUBS()