mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 18:40:29 +00:00
(svn r23309) -Fix: loading old games didn't have goals set for towns (tnx to frosch for spotting)
This commit is contained in:
parent
31f266f254
commit
bd3fd1171e
@ -2670,6 +2670,24 @@ bool AfterLoadGame()
|
||||
/* The center of train vehicles was changed, fix up spacing. */
|
||||
if (IsSavegameVersionBefore(164)) FixupTrainLengths();
|
||||
|
||||
if (IsSavegameVersionBefore(165)) {
|
||||
Town *t;
|
||||
|
||||
FOR_ALL_TOWNS(t) {
|
||||
/* Set the default cargo requirement for town growth */
|
||||
switch (_settings_game.game_creation.landscape) {
|
||||
case LT_ARCTIC:
|
||||
if (FindFirstCargoWithTownEffect(TE_FOOD) != NULL) t->goal[TE_FOOD] = TOWN_GROWTH_WINTER;
|
||||
break;
|
||||
|
||||
case LT_TROPIC:
|
||||
if (FindFirstCargoWithTownEffect(TE_FOOD) != NULL) t->goal[TE_FOOD] = TOWN_GROWTH_DESERT;
|
||||
if (FindFirstCargoWithTownEffect(TE_WATER) != NULL) t->goal[TE_WATER] = TOWN_GROWTH_DESERT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* When any NewGRF has been changed the availability of some vehicles might
|
||||
* have been changed too. e->company_avail must be set to 0 in that case
|
||||
* which is done by StartupEngines(). */
|
||||
|
Loading…
Reference in New Issue
Block a user