2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-05 19:45:33 +03:00

Merge pull request #167 from WPMGPRoSToTeMa/autoprecachemapstxtoverviewsandskys

Additional checks for WAD precaching
This commit is contained in:
theAsmodai 2016-02-07 13:39:08 +03:00
commit 41671cb4ab

View File

@ -5060,6 +5060,8 @@ void PrecacheMapSpecifiedResources()
if (FS_FileExists(va("maps/%s_detail.txt", g_psv.name)))
PF_precache_generic_I(va("maps/%s_detail.txt", g_psv.name));
if (wadpath != nullptr)
{
char tempPath[1024];
Q_strncpy(tempPath, wadpath, sizeof(tempPath) - 2);
tempPath[sizeof(tempPath) - 2] = 0;
@ -5070,14 +5072,20 @@ void PrecacheMapSpecifiedResources()
{
char wadName[MAX_QPATH];
COM_FileBase(token, wadName);
COM_DefaultExtension(wadName, ".wad");
if (Q_strstr(wadName, "pldecal") || Q_strstr(wadName, "tempdecal"))
if (!FS_FileExists(wadName)
|| !Q_stricmp(wadName, "pldecal.wad")
|| !Q_stricmp(wadName, "tempdecal.wad")
|| !Q_stricmp(wadName, "halflife.wad")
|| !Q_stricmp(wadName, "xeno.wad")
|| !Q_stricmp(wadName, "decals.wad"))
continue;
COM_DefaultExtension(wadName, ".wad");
PF_precache_generic_I(wadName);
}
}
}
#endif // REHLDS_FIXES
/* <a99d9> ../engine/sv_main.c:6557 */