mirror of https://github.com/OpenTTD/OpenTTD
(svn r20194) -Fix: compilation with network disabled failed
parent
db94e06094
commit
5b1fc7304a
|
@ -11,10 +11,10 @@
|
||||||
|
|
||||||
#include "stdafx.h"
|
#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__)
|
#if defined(UNIX) && !defined(__MORPHOS__)
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
|
@ -57,7 +57,6 @@ static bool _do_scan_working_directory = true;
|
||||||
|
|
||||||
extern char *_config_file;
|
extern char *_config_file;
|
||||||
extern char *_highscore_file;
|
extern char *_highscore_file;
|
||||||
extern char *_log_file;
|
|
||||||
|
|
||||||
/* Get current position in file */
|
/* Get current position in file */
|
||||||
size_t FioGetPos()
|
size_t FioGetPos()
|
||||||
|
@ -1035,7 +1034,6 @@ void DeterminePaths(const char *exe)
|
||||||
DEBUG(misc, 3, "%s found as personal directory", _personal_dir);
|
DEBUG(misc, 3, "%s found as personal directory", _personal_dir);
|
||||||
|
|
||||||
_highscore_file = str_fmt("%shs.dat", _personal_dir);
|
_highscore_file = str_fmt("%shs.dat", _personal_dir);
|
||||||
_log_file = str_fmt("%sopenttd.log", _personal_dir);
|
|
||||||
extern char *_hotkeys_file;
|
extern char *_hotkeys_file;
|
||||||
_hotkeys_file = str_fmt("%shotkeys.cfg", _personal_dir);
|
_hotkeys_file = str_fmt("%shotkeys.cfg", _personal_dir);
|
||||||
|
|
||||||
|
@ -1066,6 +1064,9 @@ void DeterminePaths(const char *exe)
|
||||||
FioCreateDirectory(tmp);
|
FioCreateDirectory(tmp);
|
||||||
free(tmp);
|
free(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern char *_log_file;
|
||||||
|
_log_file = str_fmt("%sopenttd.log", _personal_dir);
|
||||||
#else /* ENABLE_NETWORK */
|
#else /* ENABLE_NETWORK */
|
||||||
/* If we don't have networking, we don't need to make the directory. But
|
/* 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. */
|
* if it exists we keep it, otherwise remove it from the search paths. */
|
||||||
|
|
|
@ -85,7 +85,6 @@ void CallWindowTickEvent();
|
||||||
extern void SetDifficultyLevel(int mode, DifficultySettings *gm_opt);
|
extern void SetDifficultyLevel(int mode, DifficultySettings *gm_opt);
|
||||||
extern Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY);
|
extern Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY);
|
||||||
extern void ShowOSErrorBox(const char *buf, bool system);
|
extern void ShowOSErrorBox(const char *buf, bool system);
|
||||||
extern bool _dedicated_forks;
|
|
||||||
extern char *_config_file;
|
extern char *_config_file;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -347,7 +346,9 @@ static void ShutdownGame()
|
||||||
_engine_pool.CleanPool();
|
_engine_pool.CleanPool();
|
||||||
_company_pool.CleanPool();
|
_company_pool.CleanPool();
|
||||||
|
|
||||||
|
#ifdef ENABLE_NETWORK
|
||||||
free(_config_file);
|
free(_config_file);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Close all and any open filehandles */
|
/* Close all and any open filehandles */
|
||||||
FioCloseAll();
|
FioCloseAll();
|
||||||
|
@ -431,12 +432,14 @@ int ttd_main(int argc, char *argv[])
|
||||||
uint16 dedicated_port = 0;
|
uint16 dedicated_port = 0;
|
||||||
char *join_server_password = NULL;
|
char *join_server_password = NULL;
|
||||||
char *join_company_password = NULL;
|
char *join_company_password = NULL;
|
||||||
|
|
||||||
|
extern bool _dedicated_forks;
|
||||||
|
_dedicated_forks = false;
|
||||||
#endif /* ENABLE_NETWORK */
|
#endif /* ENABLE_NETWORK */
|
||||||
|
|
||||||
_game_mode = GM_MENU;
|
_game_mode = GM_MENU;
|
||||||
_switch_mode = SM_MENU;
|
_switch_mode = SM_MENU;
|
||||||
_switch_mode_errorstr = INVALID_STRING_ID;
|
_switch_mode_errorstr = INVALID_STRING_ID;
|
||||||
_dedicated_forks = false;
|
|
||||||
_config_file = NULL;
|
_config_file = NULL;
|
||||||
|
|
||||||
/* The last param of the following function means this:
|
/* The last param of the following function means this:
|
||||||
|
@ -562,7 +565,7 @@ int ttd_main(int argc, char *argv[])
|
||||||
BaseSounds::FindSets();
|
BaseSounds::FindSets();
|
||||||
BaseMusic::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) */
|
/* We must fork here, or we'll end up without some resources we need (like sockets) */
|
||||||
if (_dedicated_forks) DedicatedFork();
|
if (_dedicated_forks) DedicatedFork();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue