Changeset - r13672:cbb70d26ff69
[Not reviewed]
master
0 2 0
rubidium - 15 years ago 2009-11-21 16:39:36
rubidium@openttd.org
(svn r18207) -Fix [FS#3324] (r11961): [NewGRF] When starting a new game the values of action D variable 13 were incorrect
2 files changed with 4 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/genworld.cpp
Show inline comments
 
@@ -274,36 +274,37 @@ void GenerateWorld(GenerateWorldMode mod
 
	_gw.lc     = _local_company;
 
	_gw.quit_thread   = false;
 
	_gw.threaded      = true;
 

	
 
	/* This disables some commands and stuff */
 
	SetLocalCompany(COMPANY_SPECTATOR);
 
	/* Make sure everything is done via OWNER_NONE */
 
	_current_company = OWNER_NONE;
 

	
 
	/* Set the date before loading sprites as some newgrfs check it */
 
	SetDate(ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1));
 

	
 
	InitializeGame(_gw.size_x, _gw.size_y, false, reset_settings);
 
	PrepareGenerateWorldProgress();
 

	
 
	/* Load the right landscape stuff */
 
	GfxLoadSprites();
 
	LoadStringWidthTable();
 

	
 
	InitializeGame(_gw.size_x, _gw.size_y, false, reset_settings);
 
	PrepareGenerateWorldProgress();
 

	
 
	/* Re-init the windowing system */
 
	ResetWindowSystem();
 

	
 
	/* Create toolbars */
 
	SetupColoursAndInitialWindow();
 
	SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, HT_NONE, WC_MAIN_WINDOW, 0);
 

	
 
	if (_gw.thread != NULL) {
 
		_gw.thread->Join();
 
		delete _gw.thread;
 
		_gw.thread = NULL;
 
	}
 

	
 
	if (BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth() == 0 ||
 
	    !ThreadObject::New(&_GenerateWorld, NULL, &_gw.thread)) {
 
		DEBUG(misc, 1, "Cannot create genworld thread, reverting to single-threaded mode");
 
		_gw.threaded = false;
 
		_genworld_mapgen_mutex->EndCritical();
src/misc.cpp
Show inline comments
 
@@ -54,26 +54,24 @@ void InitializeCompanies();
 
void InitializeCheats();
 
void InitializeNPF();
 
void InitializeOldNames();
 

	
 
void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settings)
 
{
 
	/* Make sure there isn't any window that can influence anything
 
	 * related to the new game we're about to start/load. */
 
	UnInitWindowSystem();
 

	
 
	AllocateMap(size_x, size_y);
 

	
 
	SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, HT_NONE, WC_MAIN_WINDOW, 0);
 

	
 
	_pause_mode = PM_UNPAUSED;
 
	_fast_forward = 0;
 
	_tick_counter = 0;
 
	_realtime_tick = 0;
 
	_date_fract = 0;
 
	_cur_tileloop_tile = 0;
 
	_thd.redsq = INVALID_TILE;
 
	if (reset_settings) MakeNewgameSettingsLive();
 

	
 
	InitializeSound();
 

	
 
	if (reset_date) {
0 comments (0 inline, 0 general)