From 8afb616994d88d658168baed26693e174886ecbe Mon Sep 17 00:00:00 2001 From: MegaBrutal Date: Tue, 21 Feb 2023 23:30:00 +0100 Subject: [PATCH] Make precache logging more concise --- dllapi.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/dllapi.cpp b/dllapi.cpp index 0c8f15e..acc2906 100644 --- a/dllapi.cpp +++ b/dllapi.cpp @@ -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); -- 2.34.1