diff options
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r-- | src/openttd.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index 67553349a..b15f38aa2 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -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 |