From: havoc Date: Thu, 25 Feb 2010 15:50:24 +0000 (+0000) Subject: don't bother calling Mod_ForName in client precache parsing if server X-Git-Tag: xonotic-v0.1.0preview~230^2~472 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f170ee3a587ffab1f06680de213b033838cb0b8a;p=xonotic%2Fdarkplaces.git don't bother calling Mod_ForName in client precache parsing if server already loaded them in a local game git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9997 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_parse.c b/cl_parse.c index d5c66b79..8b5bc0ac 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -1089,13 +1089,18 @@ void CL_BeginDownloads(qboolean aborteddownload) } CL_KeepaliveMessage(true); - if(cl.loadmodel_current == 1) + // if running a local game, calling Mod_ForName is a completely wasted effort... + if (sv.active) + cl.model_precache[cl.loadmodel_current] = sv.models[cl.loadmodel_current]; + else { - // they'll be soon loaded, but make sure we apply freshly downloaded shaders from a curled pk3 - Mod_FreeQ3Shaders(); + if(cl.loadmodel_current == 1) + { + // they'll be soon loaded, but make sure we apply freshly downloaded shaders from a curled pk3 + Mod_FreeQ3Shaders(); + } + cl.model_precache[cl.loadmodel_current] = Mod_ForName(cl.model_name[cl.loadmodel_current], false, false, cl.model_name[cl.loadmodel_current][0] == '*' ? cl.model_name[1] : NULL); } - - cl.model_precache[cl.loadmodel_current] = Mod_ForName(cl.model_name[cl.loadmodel_current], false, false, cl.model_name[cl.loadmodel_current][0] == '*' ? cl.model_name[1] : NULL); SCR_PopLoadingScreen(false); if (cl.model_precache[cl.loadmodel_current] && cl.model_precache[cl.loadmodel_current]->Draw && cl.loadmodel_current == 1) {