Now checks whether there is a non-zero g_engfuncs.pfnQueryClientCvarValue before setting newdll's pfnCvarValue function pointer

This commit is contained in:
Pavol Marko 2005-09-06 16:31:07 +00:00
parent af79fe8e20
commit 66b95f64a5

View File

@ -1407,7 +1407,11 @@ C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, int *in
// default metamod does not call this if the gamedll doesn't provide it // default metamod does not call this if the gamedll doesn't provide it
g_NewDLL_Available = true; g_NewDLL_Available = true;
// If pfnQueryClientCvarValue is not available, the newdllfunctions table will probably
// not have the pfnCvarValue member -> better don't write there to avoid corruption
if (g_engfuncs.pfnQueryClientCvarValue)
gNewDLLFunctionTable.pfnCvarValue = C_CvarValue; gNewDLLFunctionTable.pfnCvarValue = C_CvarValue;
#ifdef FAKEMETA #ifdef FAKEMETA
return g_FakeMeta.GetNewDLLFunctions(pNewFunctionTable, interfaceVersion, &gNewDLLFunctionTable); return g_FakeMeta.GetNewDLLFunctions(pNewFunctionTable, interfaceVersion, &gNewDLLFunctionTable);
#else #else