summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-01-15 18:51:46 +0000
committerrubidium <rubidium@openttd.org>2008-01-15 18:51:46 +0000
commit6891bc2011621e9053c6e46d1c04a02431c93d81 (patch)
treecd46862cea14e32a966c0a3410d73ba666ef2ea4 /src/openttd.cpp
parent576f8ad93e5eb2d2c2777ae1e448ae80e80d14ba (diff)
downloadopenttd-6891bc2011621e9053c6e46d1c04a02431c93d81.tar.xz
(svn r11867) -Fix: do not reset changes to persistent storages during world generation.
-Fix: store changes to persistent storages after performing all the game logic instead of resetting them.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 2ec5db868..2dfd6e050 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -974,8 +974,6 @@ void SwitchMode(int new_mode)
* That check is enforced in DoCommand. */
void StateGameLoop()
{
- ClearStorageChanges(false);
-
/* dont execute the state loop during pause */
if (_pause_game) {
CallWindowTickEvent();
@@ -983,10 +981,14 @@ void StateGameLoop()
}
if (IsGeneratingWorld()) return;
+ ClearStorageChanges(false);
+
if (_game_mode == GM_EDITOR) {
RunTileLoop();
CallVehicleTicks();
CallLandscapeTick();
+ ClearStorageChanges(true);
+
CallWindowTickEvent();
NewsLoop();
} else {
@@ -1000,6 +1002,7 @@ void StateGameLoop()
RunTileLoop();
CallVehicleTicks();
CallLandscapeTick();
+ ClearStorageChanges(true);
AI_RunGameLoop();