Changeset - r139:8609e94887df
[Not reviewed]
master
0 1 0
truelight - 20 years ago 2004-08-25 10:17:39
truelight@openttd.org
(svn r140) -Fix: Load Scenario fix
1 file changed with 19 insertions and 12 deletions:
ttd.c
19
12
0 comments (0 inline, 0 general)
ttd.c
Show inline comments
 
@@ -20,7 +20,7 @@
 
#include "hal.h"
 
#include "airport.h"
 
#include "saveload.h"
 
#include "ai.h"
 
#include "ai.h"
 
#include "console.h"
 

	
 
#include <stdarg.h>
 
@@ -75,7 +75,7 @@ void CDECL debug(const char *s, ...)
 
	va_start(va, s);
 
	vsprintf(buf, s, va);
 
	va_end(va);
 
	fprintf(stderr, "dbg: %s\n", buf);
 
	fprintf(stderr, "dbg: %s\n", buf);
 
	IConsoleDebug((byte *) &buf);
 
}
 

	
 
@@ -571,7 +571,7 @@ int ttd_main(int argc, char* argv[])
 
	MxInitialize(11025, "sample.cat"); 
 

	
 
	// This must be done early, since functions use the InvalidateWindow* calls
 
	InitWindowSystem();
 
	InitWindowSystem();
 

	
 
	GfxLoadSprites();
 
	LoadStringWidthTable();
 
@@ -597,13 +597,13 @@ int ttd_main(int argc, char* argv[])
 
			NetworkCoreConnectGame("auto",_network_server_port);
 
			}
 
		}
 
 
	// initialize the ingame console
 
	IConsoleInit();
 

	
 
	// initialize the ingame console
 
	IConsoleInit();
 

	
 
	while (_video_driver->main_loop() == ML_SWITCHDRIVER) {}
 
 
	IConsoleFree();
 

	
 
	IConsoleFree();
 

	
 
	if (_network_available) {
 
		// shutdown network-core
 
@@ -642,7 +642,7 @@ void LoadIntroGame()
 
	_opt_mod_ptr = &_new_opt;
 
	GfxLoadSprites();
 
	LoadStringWidthTable();
 
	
 
	>
 
	// Setup main window
 
	InitWindowSystem();
 
	SetupColorsAndInitialWindow();
 
@@ -750,8 +750,10 @@ void StartScenario()
 
	StartupEngines();
 
	StartupDisasters();
 

	
 
	// Create a single player
 
	DoStartupNewPlayer(false);
 
	// When starting a scenario, is it really a load..
 
	//  and in AfterLoad a player is started when it is
 
	//  a scenario.. so we do not need it here.
 
//	DoStartupNewPlayer(false);
 
	
 
	_local_player = 0;
 

	
 
@@ -782,7 +784,7 @@ bool SafeSaveOrLoad(const char *filename
 

	
 
static void SwitchMode(int new_mode)
 
{
 
	_in_state_game_loop = true;
 
	_in_state_game_loop = true;
 
	
 
	switch(new_mode) {
 
	case SM_EDITOR: // Switch to scenario editor
 
@@ -1133,6 +1135,11 @@ bool AfterLoadGame(uint version)
 
	if (version <= 0x400) {
 
		CheckIsPlayerActive();
 
	}
 
	
 
	// If Load Scenario / New (Scenario) Game is used, 
 
	//  a player does not exist yet. So create one here.
 
	if (!_players[0].is_active)
 
		DoStartupNewPlayer(false);
 

	
 
	DoZoomInOut(ZOOM_NONE); // update button status
 
	MarkWholeScreenDirty();
0 comments (0 inline, 0 general)