Changeset - r8303:493dc45b2e13
[Not reviewed]
master
0 2 0
rubidium - 17 years ago 2008-01-15 18:51:46
rubidium@openttd.org
(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.
2 files changed with 8 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/genworld.cpp
Show inline comments
 
@@ -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 @@ static void *_GenerateWorld(void *arg)
 
		}
 
	}
 

	
 
	ClearStorageChanges(true);
 

	
 
	/* These are probably pointless when inside the scenario editor. */
 
	SetGeneratingWorldProgress(GWP_GAME_INIT, 3);
 
	StartupPlayers();
src/openttd.cpp
Show inline comments
 
@@ -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();
 

	
0 comments (0 inline, 0 general)