2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-19 10:08:04 +03:00

Additional checks for WAD precaching

This commit is contained in:
WPMGPRoSToTeMa 2016-02-07 06:23:58 +03:00
parent a300a4c84d
commit e2cc869086

View File

@ -5043,6 +5043,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;
@ -5053,13 +5055,19 @@ 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