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
This commit is contained in:
Daniel Gibson 2024-11-07 05:42:45 +01:00
parent 47d803b4fe
commit 373f59c484

View file

@ -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));
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 ) {
common->FatalError( "couldn't load game dynamic library" );
sys->DLL_GetFileName(BASE_GAMEDIR, dll, sizeof(dll));
LoadGameDLLbyName(dll, s);
}
}
if ( !gameDLL ) {
common->FatalError( "couldn't load game dynamic library '%s'", dll );
return;
}