Changeset - r15525:2b2a09331191
[Not reviewed]
master
0 3 0
rubidium - 14 years ago 2010-07-19 17:46:53
rubidium@openttd.org
(svn r20194) -Fix: compilation with network disabled failed
3 files changed with 11 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/dedicated.cpp
Show inline comments
 
@@ -11,9 +11,9 @@
 

	
 
#include "stdafx.h"
 

	
 
char *_log_file; ///< File to reroute output of a forked OpenTTD to
 
#ifdef ENABLE_NETWORK
 

	
 
#ifdef ENABLE_NETWORK
 
char *_log_file; ///< File to reroute output of a forked OpenTTD to
 

	
 
#if defined(UNIX) && !defined(__MORPHOS__)
 

	
src/fileio.cpp
Show inline comments
 
@@ -57,7 +57,6 @@ static bool _do_scan_working_directory =
 

	
 
extern char *_config_file;
 
extern char *_highscore_file;
 
extern char *_log_file;
 

	
 
/* Get current position in file */
 
size_t FioGetPos()
 
@@ -1035,7 +1034,6 @@ void DeterminePaths(const char *exe)
 
	DEBUG(misc, 3, "%s found as personal directory", _personal_dir);
 

	
 
	_highscore_file = str_fmt("%shs.dat", _personal_dir);
 
	_log_file = str_fmt("%sopenttd.log",  _personal_dir);
 
	extern char *_hotkeys_file;
 
	_hotkeys_file = str_fmt("%shotkeys.cfg",  _personal_dir);
 

	
 
@@ -1066,6 +1064,9 @@ void DeterminePaths(const char *exe)
 
		FioCreateDirectory(tmp);
 
		free(tmp);
 
	}
 

	
 
	extern char *_log_file;
 
	_log_file = str_fmt("%sopenttd.log",  _personal_dir);
 
#else /* ENABLE_NETWORK */
 
	/* If we don't have networking, we don't need to make the directory. But
 
	 * if it exists we keep it, otherwise remove it from the search paths. */
src/openttd.cpp
Show inline comments
 
@@ -85,7 +85,6 @@ void CallWindowTickEvent();
 
extern void SetDifficultyLevel(int mode, DifficultySettings *gm_opt);
 
extern Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY);
 
extern void ShowOSErrorBox(const char *buf, bool system);
 
extern bool _dedicated_forks;
 
extern char *_config_file;
 

	
 
/**
 
@@ -347,7 +346,9 @@ static void ShutdownGame()
 
	_engine_pool.CleanPool();
 
	_company_pool.CleanPool();
 

	
 
#ifdef ENABLE_NETWORK
 
	free(_config_file);
 
#endif
 

	
 
	/* Close all and any open filehandles */
 
	FioCloseAll();
 
@@ -431,12 +432,14 @@ int ttd_main(int argc, char *argv[])
 
	uint16 dedicated_port = 0;
 
	char *join_server_password = NULL;
 
	char *join_company_password = NULL;
 

	
 
	extern bool _dedicated_forks;
 
	_dedicated_forks = false;
 
#endif /* ENABLE_NETWORK */
 

	
 
	_game_mode = GM_MENU;
 
	_switch_mode = SM_MENU;
 
	_switch_mode_errorstr = INVALID_STRING_ID;
 
	_dedicated_forks = false;
 
	_config_file = NULL;
 

	
 
	/* The last param of the following function means this:
 
@@ -562,7 +565,7 @@ int ttd_main(int argc, char *argv[])
 
	BaseSounds::FindSets();
 
	BaseMusic::FindSets();
 

	
 
#if defined(UNIX) && !defined(__MORPHOS__)
 
#if defined(ENABLE_NETWORK) && defined(UNIX) && !defined(__MORPHOS__)
 
	/* We must fork here, or we'll end up without some resources we need (like sockets) */
 
	if (_dedicated_forks) DedicatedFork();
 
#endif
0 comments (0 inline, 0 general)