engine: check XASH3D_GAME if -game argument wasn't found, do not override default base directory

Clarify that `--gamedir` configure option and `XASH_GAMEDIR` macro specify base directory
This commit is contained in:
Alibek Omarov
2024-07-21 01:04:50 +03:00
parent 64726f13e1
commit 6d98d2c7c3
4 changed files with 13 additions and 18 deletions
+2 -7
View File
@@ -44,9 +44,8 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
#error // port me!
#endif
#define E_GAME "XASH3D_GAME" // default env dir to start from
#ifndef XASH_GAMEDIR
#define XASH_GAMEDIR "valve"
#define XASH_GAMEDIR "valve" // !!! Replace with your default (base) game directory !!!
#endif
typedef void (*pfnChangeGame)( const char *progname );
@@ -151,7 +150,6 @@ _inline int Sys_Start( void )
{
int ret;
pfnChangeGame changeGame = NULL;
const char *game = getenv( E_GAME );
#if XASH_SAILFISH
const char *home = getenv( "HOME" );
@@ -166,10 +164,7 @@ _inline int Sys_Start( void )
#endif // XASH_AURORAOS
#endif // XASH_SAILFISH
if( !game )
game = XASH_GAMEDIR;
strncpy( szGameDir, game, sizeof( szGameDir ) - 1 );
strncpy( szGameDir, XASH_GAMEDIR, sizeof( szGameDir ) - 1 );
Sys_LoadEngine();