2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-28 15:45:46 +03:00

Merge pull request #439 from In-line/patch-6

Optimize PF_IsMapValid_I
This commit is contained in:
theAsmodai 2017-04-25 18:43:16 +03:00 committed by GitHub
commit c895428d1d

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);
}