aboutsummaryrefslogtreecommitdiff
path: root/src/server/collision/Management
diff options
context:
space:
mode:
authorjoschiwald <joschiwald@online.de>2012-12-30 21:09:21 +0100
committerjoschiwald <joschiwald@online.de>2012-12-30 21:09:21 +0100
commit08f62d8313e05ed6eb1767eed07a7e31533e9bb6 (patch)
tree534dcdddd9b6ce2490570b105398ec0c3b374a03 /src/server/collision/Management
parent871f8c800392cdf8739a6bd4808c532ba88e85ea (diff)
Core/MMaps: use DisableMgr to disable pathfinding on a specific map
Diffstat (limited to 'src/server/collision/Management')
-rw-r--r--src/server/collision/Management/MMapFactory.cpp32
-rw-r--r--src/server/collision/Management/MMapFactory.h1
2 files changed, 2 insertions, 31 deletions
diff --git a/src/server/collision/Management/MMapFactory.cpp b/src/server/collision/Management/MMapFactory.cpp
index f4b2f3d47e4..0b292b56dca 100644
--- a/src/server/collision/Management/MMapFactory.cpp
+++ b/src/server/collision/Management/MMapFactory.cpp
@@ -19,7 +19,7 @@
#include "MMapFactory.h"
#include "World.h"
#include "Config.h"
-#include <set>
+#include "DisableMgr.h"
namespace MMAP
{
@@ -27,9 +27,6 @@ namespace MMAP
// our global singleton copy
MMapManager *g_MMapManager = NULL;
- // stores list of mapids which do not use pathfinding
- std::set<uint32>* g_mmapDisabledIds = NULL;
-
MMapManager* MMapFactory::createOrGetMMapManager()
{
if (g_MMapManager == NULL)
@@ -38,39 +35,14 @@ namespace MMAP
return g_MMapManager;
}
- void MMapFactory::preventPathfindingOnMaps(const char* ignoreMapIds)
- {
- if (!g_mmapDisabledIds)
- g_mmapDisabledIds = new std::set<uint32>();
-
- uint32 strLenght = strlen(ignoreMapIds)+1;
- char* mapList = new char[strLenght];
- memcpy(mapList, ignoreMapIds, sizeof(char)*strLenght);
-
- char* idstr = strtok(mapList, ",");
- while (idstr)
- {
- g_mmapDisabledIds->insert(uint32(atoi(idstr)));
- idstr = strtok(NULL, ",");
- }
-
- delete[] mapList;
- }
-
bool MMapFactory::IsPathfindingEnabled(uint32 mapId)
{
return sWorld->getBoolConfig(CONFIG_ENABLE_MMAPS)
- && g_mmapDisabledIds->find(mapId) == g_mmapDisabledIds->end();
+ && !DisableMgr::IsDisabledFor(DISABLE_TYPE_MMAP, mapId, NULL, MMAP_DISABLE_PATHFINDING);
}
void MMapFactory::clear()
{
- if (g_mmapDisabledIds)
- {
- delete g_mmapDisabledIds;
- g_mmapDisabledIds = NULL;
- }
-
if (g_MMapManager)
{
delete g_MMapManager;
diff --git a/src/server/collision/Management/MMapFactory.h b/src/server/collision/Management/MMapFactory.h
index ab047333a19..a006aedfa6d 100644
--- a/src/server/collision/Management/MMapFactory.h
+++ b/src/server/collision/Management/MMapFactory.h
@@ -42,7 +42,6 @@ namespace MMAP
public:
static MMapManager* createOrGetMMapManager();
static void clear();
- static void preventPathfindingOnMaps(const char* ignoreMapIds);
static bool IsPathfindingEnabled(uint32 mapId);
};
}