engine: client: do not modify internal_vgui_support field as game info must be immutable once loaded

This commit is contained in:
Alibek Omarov
2025-10-02 22:42:20 +05:00
parent 8c2c920076
commit a366f99d7d

View File

@@ -3962,6 +3962,7 @@ qboolean CL_LoadProgs( const char *name )
CL_EXPORT_FUNCS GetClientAPI; // single export
qboolean valid_single_export = false;
qboolean missed_exports = false;
qboolean try_internal_vgui_support = GI->internal_vgui_support;
int i;
if( clgame.hInstance ) CL_UnloadProgs();
@@ -3982,10 +3983,10 @@ qboolean CL_LoadProgs( const char *name )
// NOTE: important stuff!
// vgui must startup BEFORE loading client.dll to avoid get error ERROR_NOACESS during LoadLibrary
if( !GI->internal_vgui_support && VGui_LoadProgs( NULL ))
if( !try_internal_vgui_support && VGui_LoadProgs( NULL ))
VGui_Startup( refState.width, refState.height );
else
GI->internal_vgui_support = true; // we failed to load vgui_support, but let's probe client.dll for support anyway
try_internal_vgui_support = true; // we failed to load vgui_support, but let's probe client.dll for support anyway
clgame.hInstance = COM_LoadLibrary( name, false, false );
@@ -3993,7 +3994,7 @@ qboolean CL_LoadProgs( const char *name )
return false;
// delayed vgui initialization for internal support
if( GI->internal_vgui_support && VGui_LoadProgs( clgame.hInstance ))
if( try_internal_vgui_support && VGui_LoadProgs( clgame.hInstance ))
VGui_Startup( refState.width, refState.height );
// clear exports