mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Cache all models inside the models/player directory
Some player models are missing from precache scripts. This caches all models inside the player directory to avoid a short hitch when a player spawns with a non-cached model
This commit is contained in:
parent
90e46f535c
commit
92a0a9c197
1 changed files with 24 additions and 0 deletions
|
@ -1588,6 +1588,30 @@ void Level::Precache(void)
|
|||
|
||||
LoadAllScripts("global", ".scr");
|
||||
InitVoteOptions();
|
||||
|
||||
// Added in OPM
|
||||
// Cache all player models in multi-player
|
||||
// This avoids using precache scripts
|
||||
if (g_gametype->integer != GT_SINGLE_PLAYER) {
|
||||
char **fileList;
|
||||
int numFiles;
|
||||
int i;
|
||||
|
||||
fileList = gi.FS_ListFiles("models/player", ".tik", qfalse, &numFiles);
|
||||
|
||||
for (i = 0; i < numFiles; i++) {
|
||||
const char *filename = fileList[i];
|
||||
const size_t filelen = strlen(filename);
|
||||
|
||||
if (!Q_stricmpn(filename, "allied_", 7) || !Q_stricmpn(filename, "american_", 9)
|
||||
|| !Q_stricmpn(filename, "german_", 7) || !Q_stricmpn(filename, "IT_", 3)
|
||||
|| !Q_stricmpn(filename, "SC_", 3)) {
|
||||
CacheResource(va("models/player/%s", filename));
|
||||
}
|
||||
}
|
||||
|
||||
gi.FS_FreeFileList(fileList);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue