summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2014-02-23 22:03:08 +0000
committerfrosch <frosch@openttd.org>2014-02-23 22:03:08 +0000
commita32d18cbb939b240bc16d909fce71ba72c24f040 (patch)
tree1cb4fa063b33b684a3a94fe60ade548dd7703624 /src/openttd.cpp
parentc6ce57e8a7529b970ef45eb7baa00560d6f4b16b (diff)
downloadopenttd-a32d18cbb939b240bc16d909fce71ba72c24f040.tar.xz
(svn r26371) -Fix [FS#5831]: Calling DoCommandP during the gameloop cleared pending persistent storage changes.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index c0afb4a83..c901272c5 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1355,15 +1355,14 @@ void StateGameLoop()
}
if (HasModalProgress()) return;
- ClearPersistentStorageChanges(false);
-
Layouter::ReduceLineCache();
if (_game_mode == GM_EDITOR) {
+ BasePersistentStorageArray::SwitchMode(PSM_ENTER_GAMELOOP);
RunTileLoop();
CallVehicleTicks();
CallLandscapeTick();
- ClearPersistentStorageChanges(true);
+ BasePersistentStorageArray::SwitchMode(PSM_LEAVE_GAMELOOP);
UpdateLandscapingLimits();
CallWindowTickEvent();
@@ -1382,12 +1381,13 @@ void StateGameLoop()
* for multiplayer compatibility */
Backup<CompanyByte> cur_company(_current_company, OWNER_NONE, FILE_LINE);
+ BasePersistentStorageArray::SwitchMode(PSM_ENTER_GAMELOOP);
AnimateAnimatedTiles();
IncreaseDate();
RunTileLoop();
CallVehicleTicks();
CallLandscapeTick();
- ClearPersistentStorageChanges(true);
+ BasePersistentStorageArray::SwitchMode(PSM_LEAVE_GAMELOOP);
#ifndef DEBUG_DUMP_COMMANDS
AI::GameLoop();