engine: client: GetRefAPI now must return REF_API_VERSION to prevent possible issue when ref library wasn't recompiled on version bump

This commit is contained in:
Alibek Omarov 2023-12-05 13:16:01 +03:00
parent 26d229c8ca
commit 1612e2d669
2 changed files with 2 additions and 1 deletions

View File

@ -425,7 +425,7 @@ static qboolean R_LoadProgs( const char *name )
// make local copy of engfuncs to prevent overwrite it with user dll
memcpy( &gpEngfuncs, &gEngfuncs, sizeof( gpEngfuncs ));
if( !GetRefAPI( REF_API_VERSION, &ref.dllFuncs, &gpEngfuncs, &refState ))
if( GetRefAPI( REF_API_VERSION, &ref.dllFuncs, &gpEngfuncs, &refState ) != REF_API_VERSION )
{
COM_FreeLibrary( ref.hInstance );
Con_Reportf( "R_LoadProgs: can't init renderer API: wrong version\n" );

View File

@ -37,6 +37,7 @@ GNU General Public License for more details.
// 5. Removed GetSomethingByIndex calls, renderers are supposed to cache pointer values
// Removed previously unused calls
// Simplified remapping calls
// GetRefAPI is now expected to return REF_API_VERSION
#define REF_API_VERSION 5