1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-16 11:09:11 +00:00

(svn r17433) -Codechange: Store cumulated inflation in savegame and compute all prices from that instead of storing all prices separately.

Note: Savegame conversion computes the inflation from max loan. Prices from modified savegames will get lost. TTO savegames will also behave slightly different.
-Change: NewGRF price modifiers now take effect everytime when loading NewGRFs instead of once on gamestart.
This commit is contained in:
frosch
2009-09-06 18:53:57 +00:00
parent 2ce1a608a8
commit 438a429549
9 changed files with 161 additions and 227 deletions

View File

@@ -121,7 +121,7 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settin
#endif /* ENABLE_NETWORK */
InitializeAnimatedTiles();
InitializeLandscapeVariables(false);
InitializeEconomy();
ResetObjectToPlace();
@@ -132,18 +132,3 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settin
GamelogGRFAddList(_grfconfig);
GamelogStopAction();
}
/* Calculate constants that depend on the landscape type. */
void InitializeLandscapeVariables(bool only_constants)
{
if (only_constants) return;
memset(_cargo_payment_rates, 0, sizeof(_cargo_payment_rates));
memset(_cargo_payment_rates_frac, 0, sizeof(_cargo_payment_rates_frac));
const CargoSpec *cs;
FOR_ALL_CARGOSPECS(cs) {
_cargo_payment_rates[cs->Index()] = cs->initial_payment;
}
}