Merge branch 'infrastructure_sharing-sx' into jgrpp
Conflicts: src/lang/english.txt src/saveload/extended_ver_sl.cpp src/saveload/extended_ver_sl.h src/signal.cpp src/table/settings.ini src/vehicle.cpp
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
#include "../engine_func.h"
|
||||
#include "../rail_gui.h"
|
||||
#include "../core/backup_type.hpp"
|
||||
#include "../core/mem_func.hpp"
|
||||
#include "../smallmap_gui.h"
|
||||
#include "../news_func.h"
|
||||
#include "../order_backup.h"
|
||||
@@ -2389,6 +2390,20 @@ bool AfterLoadGame()
|
||||
FOR_ALL_DEPOTS(d) d->build_date = _date;
|
||||
}
|
||||
|
||||
if (SlXvIsFeatureMissing(XSLFI_INFRA_SHARING)) {
|
||||
Company *c;
|
||||
FOR_ALL_COMPANIES(c) {
|
||||
/* yearly_expenses has 3*15 entries now, saveload code gave us 3*13.
|
||||
* Move the old data to the right place in the new array and clear the new data.
|
||||
* The move has to be done in reverse order (first 2, then 1). */
|
||||
MemMoveT(&c->yearly_expenses[2][0], &c->yearly_expenses[1][11], 13);
|
||||
MemMoveT(&c->yearly_expenses[1][0], &c->yearly_expenses[0][13], 13);
|
||||
/* Clear the old location of just-moved data, so sharing income/expenses is set to 0 */
|
||||
MemSetT(&c->yearly_expenses[0][13], 0, 2);
|
||||
MemSetT(&c->yearly_expenses[1][13], 0, 2);
|
||||
}
|
||||
}
|
||||
|
||||
/* In old versions it was possible to remove an airport while a plane was
|
||||
* taking off or landing. This gives all kind of problems when building
|
||||
* another airport in the same station so we don't allow that anymore.
|
||||
|
@@ -283,7 +283,8 @@ static const SaveLoad _company_desc[] = {
|
||||
|
||||
/* yearly expenses was changed to 64-bit in savegame version 2. */
|
||||
SLE_CONDARR(CompanyProperties, yearly_expenses, SLE_FILE_I32 | SLE_VAR_I64, 3 * 13, 0, 1),
|
||||
SLE_CONDARR(CompanyProperties, yearly_expenses, SLE_INT64, 3 * 13, 2, SL_MAX_VERSION),
|
||||
SLE_CONDARR_X(CompanyProperties, yearly_expenses, SLE_INT64, 3 * 13, 2, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_INFRA_SHARING, 0, 0)),
|
||||
SLE_CONDARR_X(CompanyProperties, yearly_expenses, SLE_INT64, 3 * 15, 2, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_INFRA_SHARING)),
|
||||
|
||||
SLE_CONDVAR(CompanyProperties, is_ai, SLE_BOOL, 2, SL_MAX_VERSION),
|
||||
SLE_CONDNULL(1, 107, 111), ///< is_noai
|
||||
|
@@ -58,6 +58,7 @@ const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = {
|
||||
{ XSLFI_AUTO_TIMETABLE, XSCF_NULL, 1, 1, "auto_timetables", NULL, NULL, NULL },
|
||||
{ XSLFI_VEHICLE_REPAIR_COST, XSCF_NULL, 1, 1, "vehicle_repair_cost", NULL, NULL, NULL },
|
||||
{ XSLFI_ENH_VIEWPORT_PLANS, XSCF_IGNORABLE_ALL, 1, 1, "enh_viewport_plans", NULL, NULL, "PLAN,PLLN" },
|
||||
{ XSLFI_INFRA_SHARING, XSCF_NULL, 1, 1, "infra_sharing", NULL, NULL, NULL },
|
||||
{ XSLFI_NULL, XSCF_NULL, 0, 0, NULL, NULL, NULL, NULL },// This is the end marker
|
||||
};
|
||||
|
||||
|
@@ -33,6 +33,7 @@ enum SlXvFeatureIndex {
|
||||
XSLFI_AUTO_TIMETABLE, ///< Auto timetables and separation patch
|
||||
XSLFI_VEHICLE_REPAIR_COST, ///< Vehicle repair costs patch
|
||||
XSLFI_ENH_VIEWPORT_PLANS, ///< Enhanced viewport patch: plans
|
||||
XSLFI_INFRA_SHARING, ///< Infrastructure sharing patch
|
||||
|
||||
XSLFI_SIZE, ///< Total count of features, including null feature
|
||||
};
|
||||
|
Reference in New Issue
Block a user