Add company setting for remain at station if next order for same station

Set value on load for whether the save version had this enabled for trains
This commit is contained in:
Jonathan G Rennison
2023-04-06 01:14:02 +01:00
parent 1d05637d45
commit c9c0436e58
11 changed files with 29 additions and 4 deletions

View File

@@ -4139,6 +4139,13 @@ bool AfterLoadGame()
}
}
if (SlXvIsFeatureMissing(XSLFI_REMAIN_NEXT_ORDER_STATION)) {
for (Company *c : Company::Iterate()) {
/* Approximately the same time as when this was feature was added and unconditionally enabled */
c->settings.remain_if_next_order_same_station = SlXvIsFeaturePresent(XSLFI_TRACE_RESTRICT_TUNBRIDGE);
}
}
InitializeRoadGUI();
/* This needs to be done after conversion. */

View File

@@ -186,6 +186,7 @@ const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = {
{ XSLFI_NEWGRF_ENTITY_EXTRA, XSCF_NULL, 1, 1, "newgrf_entity_extra", nullptr, nullptr, nullptr },
{ XSLFI_TNNC_CHUNK, XSCF_IGNORABLE_ALL, 0, 1, "tnnc_chunk", nullptr, nullptr, "TNNC" },
{ XSLFI_MULTI_CARGO_SHIPS, XSCF_NULL, 1, 1, "multi_cargo_ships", nullptr, nullptr, nullptr },
{ XSLFI_REMAIN_NEXT_ORDER_STATION, XSCF_IGNORABLE_UNKNOWN, 1, 1, "remain_next_order_station", nullptr, nullptr, nullptr },
{ XSLFI_SCRIPT_INT64, XSCF_NULL, 1, 1, "script_int64", nullptr, nullptr, nullptr },
{ XSLFI_U64_TICK_COUNTER, XSCF_NULL, 1, 1, "u64_tick_counter", nullptr, nullptr, nullptr },
{ XSLFI_LINKGRAPH_TRAVEL_TIME, XSCF_NULL, 1, 1, "linkgraph_travel_time", nullptr, nullptr, nullptr },

View File

@@ -137,6 +137,7 @@ enum SlXvFeatureIndex {
XSLFI_NEWGRF_ENTITY_EXTRA, ///< NewGRF entity mappings are 16 bit
XSLFI_TNNC_CHUNK, ///< TNNC chunk
XSLFI_MULTI_CARGO_SHIPS, ///< Multi-cargo ships
XSLFI_REMAIN_NEXT_ORDER_STATION, ///< Remain in station if next order is for same station
XSLFI_SCRIPT_INT64, ///< See: SLV_SCRIPT_INT64
XSLFI_U64_TICK_COUNTER, ///< See: SLV_U64_TICK_COUNTER