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:
17
src/misc.cpp
17
src/misc.cpp
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user