Merge branch 'master' into jgrpp

# Conflicts:
#	src/game/game_gui.cpp
#	src/graph_gui.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/newgrf.cpp
#	src/order_gui.cpp
#	src/saveload/engine_sl.cpp
#	src/saveload/saveload.h
#	src/script/api/script_text.cpp
#	src/script/script_gui.cpp
#	src/settings_table.cpp
#	src/strings.cpp
#	src/table/settings/economy_settings.ini
#	src/table/settings/locale_settings.ini
#	src/timetable_gui.cpp
This commit is contained in:
Jonathan G Rennison
2023-04-10 15:11:53 +01:00
104 changed files with 527 additions and 293 deletions

View File

@@ -2385,15 +2385,15 @@ bool AfterLoadGame()
/* More companies ... */
for (Company *c : Company::Iterate()) {
if (c->bankrupt_asked == 0xFF) c->bankrupt_asked = 0xFFFF;
if (c->bankrupt_asked == 0xFF) c->bankrupt_asked = MAX_UVALUE(CompanyMask);
}
for (Engine *e : Engine::Iterate()) {
if (e->company_avail == 0xFF) e->company_avail = 0xFFFF;
if (e->company_avail == 0xFF) e->company_avail = MAX_UVALUE(CompanyMask);
}
for (Town *t : Town::Iterate()) {
if (t->have_ratings == 0xFF) t->have_ratings = 0xFFFF;
if (t->have_ratings == 0xFF) t->have_ratings = MAX_UVALUE(CompanyMask);
for (uint i = 8; i != MAX_COMPANIES; i++) t->ratings[i] = RATING_INITIAL;
}
}
@@ -3317,6 +3317,11 @@ bool AfterLoadGame()
_settings_game.locale.units_height = Clamp(_old_units, 0, 2);
}
if (IsSavegameVersionBefore(SLV_VELOCITY_NAUTICAL)) {
/* Match nautical velocity with land velocity units. */
_settings_game.locale.units_velocity_nautical = _settings_game.locale.units_velocity;
}
if (IsSavegameVersionBefore(SLV_186)) {
/* Move ObjectType from map to pool */
for (TileIndex t = 0; t < map_size; t++) {

View File

@@ -106,7 +106,7 @@ static void Load_ENGN()
* Just cancel any previews. */
e->flags &= ~4; // ENGINE_OFFER_WINDOW_OPEN
e->preview_company = INVALID_COMPANY;
e->preview_asked = (CompanyMask)-1;
e->preview_asked = MAX_UVALUE(CompanyMask);
}
}
}

View File

@@ -410,7 +410,7 @@ static bool FixTTOEngines()
/* Make sure for example monorail and maglev are available when they should be */
if (_date >= e->intro_date && HasBit(e->info.climates, 0)) {
e->flags |= ENGINE_AVAILABLE;
e->company_avail = (CompanyMask)0xFF;
e->company_avail = MAX_UVALUE(CompanyMask);
e->age = _date > e->intro_date ? (_date - e->intro_date) / 30 : 0;
}
} else {
@@ -435,7 +435,7 @@ static bool FixTTOEngines()
* if at least one of them was available. */
for (uint j = 0; j < lengthof(tto_to_ttd); j++) {
if (tto_to_ttd[j] == i && _old_engines[j].company_avail != 0) {
e->company_avail = (CompanyMask)0xFF;
e->company_avail = MAX_UVALUE(CompanyMask);
e->flags |= ENGINE_AVAILABLE;
break;
}
@@ -445,7 +445,7 @@ static bool FixTTOEngines()
}
e->preview_company = INVALID_COMPANY;
e->preview_asked = (CompanyMask)-1;
e->preview_asked = MAX_UVALUE(CompanyMask);
e->preview_wait = 0;
e->name = nullptr;
}

View File

@@ -356,6 +356,8 @@ enum SaveLoadVersion : uint16 {
SLV_NEWGRF_ROAD_STOPS, ///< 303 PR#10144 NewGRF road stops.
SLV_LINKGRAPH_EDGES, ///< 304 PR#10314 Explicitly store link graph edges destination.
SLV_VELOCITY_NAUTICAL, ///< 305 PR#10594 Separation of land and nautical velocity (knots!)
SL_MAX_VERSION, ///< Highest possible saveload version
SL_SPRING_2013_v2_0_102 = 220,

View File

@@ -75,7 +75,7 @@ struct ENGNChunkHandler : ChunkHandler {
* Just cancel any previews. */
e->flags &= ~4; // ENGINE_OFFER_WINDOW_OPEN
e->preview_company = INVALID_COMPANY;
e->preview_asked = (CompanyMask)-1;
e->preview_asked = MAX_UVALUE(CompanyMask);
}
}
}