2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-12-23 09:16:04 +01:00

Fix server library sanity checking

This commit is contained in:
Alibek Omarov 2018-04-21 00:36:14 +03:00
parent 32aa9a9f54
commit cec7bf8488

View File

@ -19,6 +19,7 @@ GNU General Public License for more details.
#include "gl_local.h"
#include "library.h"
#include "input.h"
#include "server.h" // !!svgame.hInstance
static MENUAPI GetMenuAPI;
static ADDTOUCHBUTTONTOLIST pfnAddTouchButtonToList;
@ -870,13 +871,23 @@ int pfnCheckGameDll( void )
{
void *hInst;
if( SV_Initialized( )) return true;
#if TARGET_OS_IPHONE
// loading server library drains too many ram
// so 512MB iPod Touch cannot even connect to
// to servers in cstrike
return true;
#endif
if(( hInst = COM_LoadLibrary( GI->game_dll, true, false )) != NULL )
if( svgame.hInstance )
return true;
COM_ResetLibraryError();
if(( hInst = COM_LoadLibrary( SI.gamedll, true, false )) != NULL )
{
COM_FreeLibrary( hInst );
return true;
}
MsgDev( D_WARN, "Could not load server library:\n%s", COM_GetLibraryError() );
COM_ResetLibraryError();
return false;
}