From e7d9795fc167dded2ae2a197bfb931c57d58ca67 Mon Sep 17 00:00:00 2001
From: Nicholas Hastings <nshastings@gmail.com>
Date: Thu, 10 Sep 2015 21:01:38 -0400
Subject: [PATCH] Fix IsMapValid call on non-TF2 TF2-branch games to use old
 behavior requiring only map name.

---
 core/HalfLife2.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/core/HalfLife2.cpp b/core/HalfLife2.cpp
index 39a51bd2..afc67581 100644
--- a/core/HalfLife2.cpp
+++ b/core/HalfLife2.cpp
@@ -1268,6 +1268,9 @@ SMFindMapResult CHalfLife2::FindMap(const char *pMapName, char *pFoundMap, size_
 	}
 
 	return static_cast<SMFindMapResult>(engine->FindMap(pFoundMap, static_cast<int>(nMapNameMax)));
+#elif SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_SDK2013
+	static IVEngineServer *engine21 = (IVEngineServer *)(g_SMAPI->GetEngineFactory()("VEngineServer021", nullptr));
+	return engine21->IsMapValid(pMapName) == 0 ? SMFindMapResult::NotFound : SMFindMapResult::Found;
 #else
 	return engine->IsMapValid(pMapName) == 0 ? SMFindMapResult::NotFound : SMFindMapResult::Found;
 #endif