X-Git-Url: http://git.megabrutal.com/?p=pmprecache.git;a=blobdiff_plain;f=dllapi.cpp;fp=dllapi.cpp;h=acc2906f7fbdf14bc4760285ef06b3c4ed3d5467;hp=0c8f15e6555bfdeda725239177fa02ac2ab9f7b0;hb=8afb616994d88d658168baed26693e174886ecbe;hpb=12c0b4b1f55307e989392110588fb6bb04a0d866 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);