From 63357e9ce3286ed7e82ebf142a9ac8a68a73aa14 Mon Sep 17 00:00:00 2001 From: In-line Date: Tue, 25 Apr 2017 18:41:50 +0400 Subject: [PATCH] Optimize PF_IsMapValid_I --- rehlds/engine/pr_cmds.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rehlds/engine/pr_cmds.cpp b/rehlds/engine/pr_cmds.cpp index da94826..640af1d 100644 --- a/rehlds/engine/pr_cmds.cpp +++ b/rehlds/engine/pr_cmds.cpp @@ -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); }