do not load _lod models if they do not exist (fixes client warning)
authorRudolf Polzer <divverent@alientrap.org>
Sun, 12 Dec 2010 19:05:51 +0000 (20:05 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 12 Dec 2010 19:05:51 +0000 (20:05 +0100)
qcsrc/server/miscfunctions.qc

index a2f4201..113e9f4 100644 (file)
@@ -1528,8 +1528,12 @@ void precache_playermodel(string m)
        precache_model(m);
        if(sv_loddistance1)
        {
-               precache_model(strcat(substring(m, 0, -5), "_lod1", substring(m, -4, -1)));
-               precache_model(strcat(substring(m, 0, -5), "_lod2", substring(m, -4, -1)));
+               f = strcat(substring(m, 0, -5), "_lod1", substring(m, -4, -1));
+               if(fexists(f))
+                       precache_model(f);
+               f = strcat(substring(m, 0, -5), "_lod2", substring(m, -4, -1));
+               if(fexists(f))
+                       precache_model(f);
        }
 
        globhandle = search_begin(strcat(m, "_*.sounds"), TRUE, FALSE);