Update IsMapValid for today's TF2 update.

This commit is contained in:
Nicholas Hastings 2015-06-11 17:48:58 -04:00
parent a4821f9389
commit c0d4dfa6ed
4 changed files with 10 additions and 8 deletions

View File

@ -1238,7 +1238,13 @@ bool CHalfLife2::IsMapValid(const char *map)
if (!map || !map[0]) if (!map || !map[0])
return false; return false;
bool ret = engine->IsMapValid(map); bool ret;
#if SOURCE_ENGINE == SE_TF2
char szTmp[PLATFORM_MAX_PATH];
strncopy(szTmp, map, sizeof(szTmp));
ret = engine->FindMap(szTmp, sizeof(szTmp)) != eFindMap_NotFound;
#else
ret = engine->IsMapValid(map);
#if SOURCE_ENGINE >= SE_LEFT4DEAD #if SOURCE_ENGINE >= SE_LEFT4DEAD
if (!ret) if (!ret)
{ {
@ -1249,5 +1255,6 @@ bool CHalfLife2::IsMapValid(const char *map)
} }
} }
#endif #endif
#endif // SE_TF2
return ret; return ret;
} }

View File

@ -52,7 +52,7 @@ using namespace SourceHook;
* Add 1 to the RHS of this expression to bump the intercom file * Add 1 to the RHS of this expression to bump the intercom file
* This is to prevent mismatching core/logic binaries * This is to prevent mismatching core/logic binaries
*/ */
#define SM_LOGIC_MAGIC (0x0F47C0DE - 29) #define SM_LOGIC_MAGIC (0x0F47C0DE - 30)
#if defined SM_LOGIC #if defined SM_LOGIC
class IVEngineServer class IVEngineServer
@ -61,7 +61,6 @@ class IVEngineServer_Logic
#endif #endif
{ {
public: public:
virtual bool IsMapValid(const char *map) = 0;
virtual bool IsDedicatedServer() = 0; virtual bool IsDedicatedServer() = 0;
virtual void InsertServerCommand(const char *cmd) = 0; virtual void InsertServerCommand(const char *cmd) = 0;
virtual void ServerCommand(const char *cmd) = 0; virtual void ServerCommand(const char *cmd) = 0;

View File

@ -371,7 +371,7 @@ public:
UTIL_StripExtension(fileName, buffer, sizeof(buffer)); UTIL_StripExtension(fileName, buffer, sizeof(buffer));
if (!engine->IsMapValid(buffer)) if (!gamehelpers->IsMapValid(buffer))
{ {
fileName = smcore.filesystem->FindNext(findHandle); fileName = smcore.filesystem->FindNext(findHandle);
continue; continue;

View File

@ -92,10 +92,6 @@ ILogger *logger;
class VEngineServer_Logic : public IVEngineServer_Logic class VEngineServer_Logic : public IVEngineServer_Logic
{ {
public: public:
virtual bool IsMapValid(const char *map)
{
return !!engine->IsMapValid(map);
}
virtual bool IsDedicatedServer() virtual bool IsDedicatedServer()
{ {
return engine->IsDedicatedServer(); return engine->IsDedicatedServer();