Merge branch 'master' into jgrpp
# Conflicts: # src/debug.cpp # src/saveload/afterload.cpp # src/saveload/saveload.cpp # src/settings_type.h # src/town_cmd.cpp # src/window.cpp
This commit is contained in:
@@ -3238,6 +3238,20 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
if (SlXvIsFeatureMissing(XSLFI_TIMETABLES_START_TICKS)) {
|
||||
// savegame timetable start is in days, but we want it in ticks, fix it up
|
||||
Vehicle *v;
|
||||
|
@@ -273,8 +273,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
|
||||
|
@@ -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:
|
||||
|
Reference in New Issue
Block a user