diff --git a/engine/common/filesystem_engine.c b/engine/common/filesystem_engine.c index 9bb729adc..71c9c468a 100644 --- a/engine/common/filesystem_engine.c +++ b/engine/common/filesystem_engine.c @@ -186,15 +186,20 @@ static qboolean FS_DetermineRootDirectory( char *out, size_t size ) Sys_Error( "couldn't find %s data directory", XASH_ENGINE_NAME ); return false; #elif ( XASH_SDL == 2 ) && !XASH_NSWITCH // GetBasePath not impl'd in switch-sdl2 -#if XASH_APPLE - path = SDL_GetPrefPath( NULL, XASH_ENGINE_NAME ); -#else path = SDL_GetBasePath(); + +#if XASH_APPLE + if( path != NULL && Q_stristr( path, ".app" )) + { + SDL_free((void *)path ); + path = SDL_GetPrefPath( NULL, XASH_ENGINE_NAME ); + } #endif + if( path != NULL ) { Q_strncpy( out, path, size ); - SDL_free(( void *)path ); + SDL_free((void *)path ); return true; }