# HG changeset patch # User rubidium # Date 1200423106 0 # Node ID cbb07f7426fcff64fb599b63e732b32d3b7d8ec9 # Parent ed068d41cf1ebfaf5ab303a4f29a95c1ec1068ab (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. diff -r ed068d41cf1e -r cbb07f7426fc src/genworld.cpp --- a/src/genworld.cpp Tue Jan 15 18:44:22 2008 +0000 +++ b/src/genworld.cpp Tue Jan 15 18:51:46 2008 +0000 @@ -23,6 +23,7 @@ #include "core/random_func.hpp" #include "engine.h" #include "settings_type.h" +#include "newgrf_storage.h" #include "table/sprites.h" @@ -118,6 +119,8 @@ } } + ClearStorageChanges(true); + /* These are probably pointless when inside the scenario editor. */ SetGeneratingWorldProgress(GWP_GAME_INIT, 3); StartupPlayers(); diff -r ed068d41cf1e -r cbb07f7426fc src/openttd.cpp --- a/src/openttd.cpp Tue Jan 15 18:44:22 2008 +0000 +++ b/src/openttd.cpp Tue Jan 15 18:51:46 2008 +0000 @@ -974,8 +974,6 @@ * 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 @@ } if (IsGeneratingWorld()) return; + ClearStorageChanges(false); + if (_game_mode == GM_EDITOR) { RunTileLoop(); CallVehicleTicks(); CallLandscapeTick(); + ClearStorageChanges(true); + CallWindowTickEvent(); NewsLoop(); } else { @@ -1000,6 +1002,7 @@ RunTileLoop(); CallVehicleTicks(); CallLandscapeTick(); + ClearStorageChanges(true); AI_RunGameLoop();