Merge branch 'master' into save_ext
# Conflicts: # src/saveload/saveload.cpp
This commit is contained in:
@@ -2969,6 +2969,19 @@ bool AfterLoadGame()
|
||||
#endif
|
||||
}
|
||||
|
||||
if (IsSavegameVersionBefore(198)) {
|
||||
/* Convert towns growth_rate and grow_counter to ticks */
|
||||
Town *t;
|
||||
FOR_ALL_TOWNS(t) {
|
||||
/* 0x8000 = TOWN_GROWTH_RATE_CUSTOM previously */
|
||||
if (t->growth_rate & 0x8000) SetBit(t->flags, TOWN_CUSTOM_GROWTH);
|
||||
if (t->growth_rate != TOWN_GROWTH_RATE_NONE) {
|
||||
t->growth_rate = TownTicksToGameTicks(t->growth_rate & ~0x8000);
|
||||
}
|
||||
/* Add t->index % TOWN_GROWTH_TICKS to spread growth across ticks. */
|
||||
t->grow_counter = TownTicksToGameTicks(t->grow_counter) + t->index % TOWN_GROWTH_TICKS;
|
||||
}
|
||||
}
|
||||
|
||||
/* Station acceptance is some kind of cache */
|
||||
if (IsSavegameVersionBefore(127)) {
|
||||
|
@@ -260,7 +260,7 @@ static const SaveLoad _company_desc[] = {
|
||||
|
||||
SLE_VAR(CompanyProperties, colour, SLE_UINT8),
|
||||
SLE_VAR(CompanyProperties, money_fraction, SLE_UINT8),
|
||||
SLE_CONDVAR(CompanyProperties, avail_railtypes, SLE_VAR_I32 | SLE_FILE_I8, 0, 57),
|
||||
SLE_CONDNULL(1, 0, 57), ///< avail_railtypes
|
||||
SLE_VAR(CompanyProperties, block_preview, SLE_UINT8),
|
||||
|
||||
SLE_CONDNULL(2, 0, 93), ///< cargo_types
|
||||
|
@@ -946,7 +946,7 @@ static const OldChunks _company_chunk[] = {
|
||||
|
||||
OCL_SVAR( OC_UINT8, Company, block_preview ),
|
||||
OCL_CNULL( OC_TTD, 1 ), // Old AI
|
||||
OCL_SVAR( OC_TTD | OC_UINT8, Company, avail_railtypes ),
|
||||
OCL_CNULL( OC_TTD, 1 ), // avail_railtypes
|
||||
OCL_SVAR( OC_TILE, Company, location_of_HQ ),
|
||||
OCL_SVAR( OC_TTD | OC_UINT8, Company, share_owners[0] ),
|
||||
OCL_SVAR( OC_TTD | OC_UINT8, Company, share_owners[1] ),
|
||||
|
@@ -270,8 +270,9 @@
|
||||
* 195 27572 1.6.x
|
||||
* 196 27778 1.7.x
|
||||
* 197 27978 1.8.x
|
||||
* 198
|
||||
*/
|
||||
extern const uint16 SAVEGAME_VERSION = 197; ///< Current savegame version of OpenTTD.
|
||||
extern const uint16 SAVEGAME_VERSION = 198; ///< Current savegame version of OpenTTD.
|
||||
const uint16 SAVEGAME_VERSION_EXT = 0x8000; ///< Savegame extension indicator mask
|
||||
|
||||
SavegameType _savegame_type; ///< type of savegame we are loading
|
||||
|
@@ -295,7 +295,7 @@ static void Load_TOWN()
|
||||
SlObject(&t->cargo_accepted, GetTileMatrixDesc());
|
||||
if (t->cargo_accepted.area.w != 0) {
|
||||
uint arr_len = t->cargo_accepted.area.w / AcceptanceMatrix::GRID * t->cargo_accepted.area.h / AcceptanceMatrix::GRID;
|
||||
t->cargo_accepted.data = MallocT<uint32>(arr_len);
|
||||
t->cargo_accepted.data = MallocT<CargoTypes>(arr_len);
|
||||
SlArray(t->cargo_accepted.data, arr_len, SLE_UINT32);
|
||||
|
||||
/* Rebuild total cargo acceptance. */
|
||||
|
@@ -433,8 +433,8 @@ void AfterLoadVehicles(bool part_of_load)
|
||||
RoadVehicle *rv = RoadVehicle::From(v);
|
||||
rv->roadtype = HasBit(EngInfo(v->First()->engine_type)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD;
|
||||
rv->compatible_roadtypes = RoadTypeToRoadTypes(rv->roadtype);
|
||||
FALLTHROUGH;
|
||||
}
|
||||
FALLTHROUGH;
|
||||
|
||||
case VEH_TRAIN:
|
||||
case VEH_SHIP:
|
||||
@@ -461,7 +461,7 @@ void AfterLoadVehicles(bool part_of_load)
|
||||
default: break;
|
||||
}
|
||||
|
||||
v->UpdateDeltaXY(v->direction);
|
||||
v->UpdateDeltaXY();
|
||||
v->coord.left = INVALID_COORD;
|
||||
v->UpdatePosition();
|
||||
v->UpdateViewport(false);
|
||||
|
Reference in New Issue
Block a user