From 373f59c4841fec726c672cb6aa2373d15ea2cc43 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Thu, 7 Nov 2024 05:42:45 +0100 Subject: [PATCH] If game DLL isn't found, fall back to fs_game_base DLL loosely based on #517, with additional fallback to base.dll if the one for fs_game_base isn't found either --- neo/framework/Common.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/neo/framework/Common.cpp b/neo/framework/Common.cpp index e4d5d07c..668b25ab 100644 --- a/neo/framework/Common.cpp +++ b/neo/framework/Common.cpp @@ -2688,13 +2688,27 @@ void idCommonLocal::LoadGameDLL( void ) { // there was no gamelib for this mod, use default one from base game if (!gameDLL) { common->Printf( "\n" ); - common->Warning( "couldn't load mod-specific %s, defaulting to base game's library!\n", dll ); - sys->DLL_GetFileName(BASE_GAMEDIR, dll, sizeof(dll)); - LoadGameDLLbyName(dll, s); + + const char *fs_base = cvarSystem->GetCVarString("fs_game_base"); + if (fs_base && fs_base[0]) { + common->Warning( "couldn't load mod-specific %s, defaulting to library of fs_game_base (%s)!\n", dll, fs_base); + sys->DLL_GetFileName(fs_base, dll, sizeof(dll)); + LoadGameDLLbyName(dll, s); + if ( !gameDLL ) { + common->Warning( "couldn't load fs_game_base lib %s either, defaulting to base game's library!\n", dll); + } + } else { + common->Warning( "couldn't load mod-specific %s, defaulting to base game's library!\n", dll ); + } + + if ( !gameDLL ) { + sys->DLL_GetFileName(BASE_GAMEDIR, dll, sizeof(dll)); + LoadGameDLLbyName(dll, s); + } } if ( !gameDLL ) { - common->FatalError( "couldn't load game dynamic library" ); + common->FatalError( "couldn't load game dynamic library '%s'", dll ); return; }