From cec7bf8488cf4dc80d5ebb50d657af1b26f551c0 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 21 Apr 2018 00:36:14 +0300 Subject: [PATCH] Fix server library sanity checking --- engine/client/cl_gameui.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/engine/client/cl_gameui.c b/engine/client/cl_gameui.c index 3b1223fa..beeb9373 100644 --- a/engine/client/cl_gameui.c +++ b/engine/client/cl_gameui.c @@ -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( svgame.hInstance ) + return true; - if(( hInst = COM_LoadLibrary( GI->game_dll, true, false )) != NULL ) + 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; }