]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
don't bother calling Mod_ForName in client precache parsing if server
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 25 Feb 2010 15:50:24 +0000 (15:50 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 25 Feb 2010 15:50:24 +0000 (15:50 +0000)
already loaded them in a local game

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9997 d7cf8633-e32d-0410-b094-e92efae38249

cl_parse.c

index d5c66b79daebcab9bbb1b3559e1ccb03574cb378..8b5bc0ac1fc1c2b0ed4bf6259de59fff72eb6034 100644 (file)
@@ -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)
                        {