2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-16 00:28:20 +03:00

Optimize PF_IsMapValid_I

This commit is contained in:
In-line 2017-04-25 18:41:50 +04:00 committed by GitHub
parent 7efc256c7c
commit 63357e9ce3

View File

@ -1541,11 +1541,15 @@ int EXT_FUNC PF_precache_generic_I(const char *s)
int EXT_FUNC PF_IsMapValid_I(const char *mapname)
{
#ifdef REHLDS_FIXES
char cBuf[42];
if (!mapname || mapname[0] == '\0')
#else
char cBuf[260];
if (!mapname || Q_strlen(mapname) == 0)
#endif
return 0;
Q_snprintf(cBuf, sizeof(cBuf), "maps/%.32s.bsp", mapname);
return FS_FileExists(cBuf);
}