Make precache logging more concise
authorMegaBrutal <megabrutal+github@megabrutal.com>
Tue, 21 Feb 2023 22:30:00 +0000 (23:30 +0100)
committerMegaBrutal <megabrutal+github@megabrutal.com>
Tue, 21 Feb 2023 22:30:00 +0000 (23:30 +0100)
dllapi.cpp

index 0c8f15e6555bfdeda725239177fa02ac2ab9f7b0..acc2906f7fbdf14bc4760285ef06b3c4ed3d5467 100644 (file)
@@ -117,17 +117,16 @@ void ClientPutInServer( edict_t *pEntity ) {
 }
 
 void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax) {
+       bool hasBMP;
        LOG_MESSAGE(PLID, "Precaching %d player models", precache_count);
        for (int i = 0; i < precache_count; i++) {
-               LOG_MESSAGE(PLID, "Precaching model: %s (contributed by %s)", precache_list[i].modelname, precache_list[i].playername);
-               g_engfuncs.pfnPrecacheModel( precache_list[i].paths.model );
-               if (fileExists( precache_list[i].paths.bmp ))
-               {
-                       LOG_MESSAGE(PLID, "Precaching bmp: %s", precache_list[i].paths.bmp);
-                       g_engfuncs.pfnPrecacheGeneric( precache_list[i].paths.bmp );
-               }
-               else
-                       LOG_MESSAGE(PLID, "File not found: %s", precache_list[i].paths.bmp);
+               hasBMP = fileExists(precache_list[i].paths.bmp);
+               LOG_MESSAGE(PLID, "Precaching model %s: %s (contributed by %s)",
+                       hasBMP ? "(with bmp)" : "(without bmp)",
+                       precache_list[i].modelname, precache_list[i].playername);
+               g_engfuncs.pfnPrecacheModel(precache_list[i].paths.model);
+               if (hasBMP)
+                       g_engfuncs.pfnPrecacheGeneric(precache_list[i].paths.bmp);
        }
        precache_count = 0;
        RETURN_META(MRES_HANDLED);