From: MegaBrutal Date: Fri, 28 Mar 2025 01:30:00 +0000 (+0100) Subject: Add teamplay models to precache list X-Git-Url: http://git.megabrutal.com/?a=commitdiff_plain;h=2ca034391d33dc4b3832434ab8fe0dd01e118bf2;p=pmprecache.git Add teamplay models to precache list --- diff --git a/dllapi.cpp b/dllapi.cpp index 942fc91..436c638 100644 --- a/dllapi.cpp +++ b/dllapi.cpp @@ -126,6 +126,22 @@ void ClientPutInServer( edict_t *pEntity ) { } void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax) { + // Precache teamplay models, if it's teamplay + if (gpGlobals->teamplay) { + LOG_MESSAGE(PLID, "Adding teamplay models to precache list"); + char teamlist[256]; + strncpy(teamlist, CVAR_GET_STRING("mp_teamlist"), 255); + char *teammodel = strtok(teamlist, ";"); + + while (teammodel != NULL) { + if (addPrecacheEntry( "server teamplay", teammodel )) + LOG_MESSAGE(PLID, "Added teamplay model %s to precache list", teammodel); + else + LOG_MESSAGE(PLID, "Teamplay model %s not added - redundant or precache list is full", teammodel); + teammodel = strtok(NULL, ";"); + } + } + bool hasBMP, hasTMDL; LOG_MESSAGE(PLID, "Precaching %d player models", precache_count); for (int i = 0; i < precache_count; i++) {