From b781a4dc332b7d37bcae7e908f08ca2171c0e30b Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 8 Oct 2014 17:59:27 +0200 Subject: Core/Logging: Replaced direct calls to GetCounter() in logs with ToString() --- src/server/scripts/Commands/cs_debug.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 6a810070347..d3d012e70d5 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -558,10 +558,10 @@ public: for (uint8 j = 0; j < bag->GetBagSize(); ++j) if (Item* item2 = bag->GetItemByPos(j)) if (item2->GetState() == state) - handler->PSendSysMessage("bag: 255 slot: %d guid: %d owner: %d", item2->GetSlot(), item2->GetGUIDLow(), item2->GetOwnerGUID().GetCounter()); + handler->PSendSysMessage("bag: 255 slot: %d %s owner: %s", item2->GetSlot(), item2->GetGUID().ToString().c_str(), item2->GetOwnerGUID().ToString().c_str()); } else if (item->GetState() == state) - handler->PSendSysMessage("bag: 255 slot: %d guid: %d owner: %d", item->GetSlot(), item->GetGUIDLow(), item->GetOwnerGUID().GetCounter()); + handler->PSendSysMessage("bag: 255 slot: %d %s owner: %s", item->GetSlot(), item->GetGUID().ToString().c_str(), item->GetOwnerGUID().ToString().c_str()); } } } @@ -623,14 +623,14 @@ public: if (item->GetOwnerGUID() != player->GetGUID()) { - handler->PSendSysMessage("The item with slot %d and itemguid %d does have non-matching owner guid (%d) and player guid (%d) !", item->GetSlot(), item->GetGUIDLow(), item->GetOwnerGUID().GetCounter(), player->GetGUIDLow()); + handler->PSendSysMessage("The item with slot %d %s does have non-matching owner guid %s and %s!", item->GetSlot(), item->GetGUID().ToString().c_str(), item->GetOwnerGUID().ToString().c_str(), player->GetGUID().ToString().c_str()); error = true; continue; } if (Bag* container = item->GetContainer()) { - handler->PSendSysMessage("The item with slot %d and guid %d has a container (slot: %d, guid: %d) but shouldn't!", item->GetSlot(), item->GetGUIDLow(), container->GetSlot(), container->GetGUIDLow()); + handler->PSendSysMessage("The item with slot %d %s has a container (slot: %d, %s) but shouldn't!", item->GetSlot(), item->GetGUID().ToString().c_str(), container->GetSlot(), container->GetGUID().ToString().c_str()); error = true; continue; } @@ -683,7 +683,7 @@ public: if (item2->GetOwnerGUID() != player->GetGUID()) { - handler->PSendSysMessage("The item in bag %d at slot %d and with itemguid %d, the owner's guid (%d) and the player's guid (%d) don't match!", bag->GetSlot(), item2->GetSlot(), item2->GetGUIDLow(), item2->GetOwnerGUID().GetCounter(), player->GetGUIDLow()); + handler->PSendSysMessage("The item in bag %d at slot %d and %s, the owner (%s) and the player (%s) don't match!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString().c_str(), item2->GetOwnerGUID().ToString().c_str(), player->GetGUID().ToString().c_str()); error = true; continue; } @@ -691,14 +691,14 @@ public: Bag* container = item2->GetContainer(); if (!container) { - handler->PSendSysMessage("The item in bag %d at slot %d with guid %d has no container!", bag->GetSlot(), item2->GetSlot(), item2->GetGUIDLow()); + handler->PSendSysMessage("The item in bag %d at slot %d %s has no container!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString().c_str()); error = true; continue; } if (container != bag) { - handler->PSendSysMessage("The item in bag %d at slot %d with guid %d has a different container(slot %d guid %d)!", bag->GetSlot(), item2->GetSlot(), item2->GetGUIDLow(), container->GetSlot(), container->GetGUIDLow()); + handler->PSendSysMessage("The item in bag %d at slot %d %s has a different container(slot %d %s)!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString().c_str(), container->GetSlot(), container->GetGUID().ToString().c_str()); error = true; continue; } @@ -745,14 +745,14 @@ public: if (item->GetOwnerGUID() != player->GetGUID()) { - handler->PSendSysMessage("queue(%zu): For the item with guid %d, the owner's guid (%d) and the player's guid (%d) don't match!", i, item->GetGUIDLow(), item->GetOwnerGUID().GetCounter(), player->GetGUIDLow()); + handler->PSendSysMessage("queue(%zu): For the item %s, the owner (%s) and the player (%s) don't match!", i, item->GetGUID().ToString().c_str(), item->GetOwnerGUID().ToString().c_str(), player->GetGUID().ToString().c_str()); error = true; continue; } if (item->GetQueuePos() != i) { - handler->PSendSysMessage("queue(%zu): For the item with guid %d, the queuepos doesn't match it's position in the queue!", i, item->GetGUIDLow()); + handler->PSendSysMessage("queue(%zu): For the item %s, the queuepos doesn't match it's position in the queue!", i, item->GetGUID().ToString().c_str()); error = true; continue; } @@ -764,14 +764,14 @@ public: if (test == NULL) { - handler->PSendSysMessage("queue(%zu): The bag(%d) and slot(%d) values for the item with guid %d are incorrect, the player doesn't have any item at that position!", i, item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow()); + handler->PSendSysMessage("queue(%zu): The bag(%d) and slot(%d) values for %s are incorrect, the player doesn't have any item at that position!", i, item->GetBagSlot(), item->GetSlot(), item->GetGUID().ToString().c_str()); error = true; continue; } if (test != item) { - handler->PSendSysMessage("queue(%zu): The bag(%d) and slot(%d) values for the item with guid %d are incorrect, an item which guid is %d is there instead!", i, item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow(), test->GetGUIDLow()); + handler->PSendSysMessage("queue(%zu): The bag(%d) and slot(%d) values for the %s are incorrect, %s is there instead!", i, item->GetBagSlot(), item->GetSlot(), item->GetGUID().ToString().c_str(), test->GetGUID().ToString().c_str()); error = true; continue; } -- cgit v1.2.3 From 9e7a9ff6e19926d51a747eac172ec1723ad5561c Mon Sep 17 00:00:00 2001 From: MitchesD Date: Thu, 9 Oct 2014 16:42:08 +0200 Subject: Scripts/Dalaran: remove unneeded script --- src/server/scripts/Northrend/zone_dalaran.cpp | 47 +-------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Northrend/zone_dalaran.cpp b/src/server/scripts/Northrend/zone_dalaran.cpp index fb5e63a2301..27d3e6dadc6 100644 --- a/src/server/scripts/Northrend/zone_dalaran.cpp +++ b/src/server/scripts/Northrend/zone_dalaran.cpp @@ -128,50 +128,6 @@ public: } }; -/*###### -## npc_hira_snowdawn -######*/ - -enum HiraSnowdawn -{ - SPELL_COLD_WEATHER_FLYING = 54197 -}; - -#define GOSSIP_TEXT_TRAIN_HIRA "I seek training to ride a steed." - -class npc_hira_snowdawn : public CreatureScript -{ -public: - npc_hira_snowdawn() : CreatureScript("npc_hira_snowdawn") { } - - bool OnGossipHello(Player* player, Creature* creature) override - { - if (!creature->IsVendor() || !creature->IsTrainer()) - return false; - - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_TRAIN_HIRA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); - - if (player->getLevel() >= 80 && player->HasSpell(SPELL_COLD_WEATHER_FLYING)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_TRAIN) - player->GetSession()->SendTrainerList(creature->GetGUID()); - - if (action == GOSSIP_ACTION_TRADE) - player->GetSession()->SendListInventory(creature->GetGUID()); - - return true; - } -}; - enum MinigobData { ZONE_DALARAN = 4395, @@ -284,7 +240,6 @@ class npc_minigob_manabonk : public CreatureScript void AddSC_dalaran() { - new npc_mageguard_dalaran; - new npc_hira_snowdawn; + new npc_mageguard_dalaran(); new npc_minigob_manabonk(); } -- cgit v1.2.3 From 67f9d916cbd920ee72b3e9036e13d0725b38566e Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 9 Oct 2014 23:01:31 +0200 Subject: Build: Fixed game & collision depending on each other for linking --- src/server/collision/Management/MMapFactory.cpp | 8 ------- src/server/collision/Management/VMapManager2.cpp | 16 ++++++------- src/server/collision/Management/VMapManager2.h | 17 ++++++++++++++ src/server/game/Conditions/DisableMgr.cpp | 29 ++++++++++++++++-------- src/server/game/Conditions/DisableMgr.h | 11 +++------ src/server/game/Maps/Map.cpp | 3 ++- src/server/game/Movement/PathGenerator.cpp | 4 ++-- src/server/game/World/World.cpp | 7 ++++++ src/server/scripts/Commands/cs_misc.cpp | 3 ++- src/server/scripts/Commands/cs_mmaps.cpp | 3 ++- src/tools/mmaps_generator/MapBuilder.cpp | 8 ------- src/tools/mmaps_generator/PathCommon.h | 2 +- 12 files changed, 64 insertions(+), 47 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/collision/Management/MMapFactory.cpp b/src/server/collision/Management/MMapFactory.cpp index b08cd92d638..51f016f6e96 100644 --- a/src/server/collision/Management/MMapFactory.cpp +++ b/src/server/collision/Management/MMapFactory.cpp @@ -17,9 +17,7 @@ */ #include "MMapFactory.h" -#include "World.h" #include "Config.h" -#include "DisableMgr.h" namespace MMAP { @@ -35,12 +33,6 @@ namespace MMAP return g_MMapManager; } - bool MMapFactory::IsPathfindingEnabled(uint32 mapId) - { - return sWorld->getBoolConfig(CONFIG_ENABLE_MMAPS) - && !DisableMgr::IsDisabledFor(DISABLE_TYPE_MMAP, mapId, NULL, MMAP_DISABLE_PATHFINDING); - } - void MMapFactory::clear() { if (g_MMapManager) diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index 484fdcd8ea4..18d7a3849bb 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -25,8 +25,6 @@ #include "ModelInstance.h" #include "WorldModel.h" #include -#include "DisableMgr.h" -#include "DBCStores.h" #include "Log.h" #include "VMapDefinitions.h" @@ -36,6 +34,8 @@ namespace VMAP { VMapManager2::VMapManager2() { + GetLiquidFlagsPtr = &GetLiquidFlagsDummy; + IsVMAPDisabledForPtr = &IsVMAPDisabledForDummy; } VMapManager2::~VMapManager2(void) @@ -134,7 +134,7 @@ namespace VMAP bool VMapManager2::isInLineOfSight(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2) { - if (!isLineOfSightCalcEnabled() || DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LOS)) + if (!isLineOfSightCalcEnabled() || IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_LOS)) return true; InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(mapId); @@ -157,7 +157,7 @@ namespace VMAP */ bool VMapManager2::getObjectHitPos(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float &ry, float& rz, float modifyDist) { - if (isLineOfSightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LOS)) + if (isLineOfSightCalcEnabled() && !IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_LOS)) { InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(mapId); if (instanceTree != iInstanceMapTrees.end()) @@ -187,7 +187,7 @@ namespace VMAP float VMapManager2::getHeight(unsigned int mapId, float x, float y, float z, float maxSearchDist) { - if (isHeightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_HEIGHT)) + if (isHeightCalcEnabled() && !IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_HEIGHT)) { InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(mapId); if (instanceTree != iInstanceMapTrees.end()) @@ -206,7 +206,7 @@ namespace VMAP bool VMapManager2::getAreaInfo(unsigned int mapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const { - if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_AREAFLAG)) + if (!IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_AREAFLAG)) { InstanceTreeMap::const_iterator instanceTree = iInstanceMapTrees.find(mapId); if (instanceTree != iInstanceMapTrees.end()) @@ -224,7 +224,7 @@ namespace VMAP bool VMapManager2::GetLiquidLevel(uint32 mapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type) const { - if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LIQUIDSTATUS)) + if (!IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_LIQUIDSTATUS)) { InstanceTreeMap::const_iterator instanceTree = iInstanceMapTrees.find(mapId); if (instanceTree != iInstanceMapTrees.end()) @@ -236,7 +236,7 @@ namespace VMAP floor = info.ground_Z; ASSERT(floor < std::numeric_limits::max()); type = info.hitModel->GetLiquidType(); // entry from LiquidType.dbc - if (reqLiquidType && !(GetLiquidFlags(type) & reqLiquidType)) + if (reqLiquidType && !(GetLiquidFlagsPtr(type) & reqLiquidType)) return false; if (info.hitInstance->GetLiquidLevel(pos, info, level)) return true; diff --git a/src/server/collision/Management/VMapManager2.h b/src/server/collision/Management/VMapManager2.h index 04292e7d8e4..9c419270b5a 100644 --- a/src/server/collision/Management/VMapManager2.h +++ b/src/server/collision/Management/VMapManager2.h @@ -66,6 +66,14 @@ namespace VMAP typedef std::unordered_map InstanceTreeMap; typedef std::unordered_map ModelFileMap; + enum DisableTypes + { + VMAP_DISABLE_AREAFLAG = 0x1, + VMAP_DISABLE_HEIGHT = 0x2, + VMAP_DISABLE_LOS = 0x4, + VMAP_DISABLE_LIQUIDSTATUS = 0x8 + }; + class VMapManager2 : public IVMapManager { protected: @@ -78,6 +86,9 @@ namespace VMAP bool _loadMap(uint32 mapId, const std::string& basePath, uint32 tileX, uint32 tileY); /* void _unloadMap(uint32 pMapId, uint32 x, uint32 y); */ + static uint32 GetLiquidFlagsDummy(uint32) { return 0; } + static bool IsVMAPDisabledForDummy(uint32 /*entry*/, uint8 /*flags*/) { return false; } + public: // public for debug G3D::Vector3 convertPositionToInternalRep(float x, float y, float z) const; @@ -114,6 +125,12 @@ namespace VMAP virtual bool existsMap(const char* basePath, unsigned int mapId, int x, int y) override; public: void getInstanceMapTree(InstanceTreeMap &instanceMapTree); + + typedef uint32(*GetLiquidFlagsFn)(uint32 liquidType); + GetLiquidFlagsFn GetLiquidFlagsPtr; + + typedef bool(*IsVMAPDisabledForFn)(uint32 entry, uint8 flags); + IsVMAPDisabledForFn IsVMAPDisabledForPtr; }; } diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index 3f325be1e83..eb50545b510 100644 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -21,8 +21,8 @@ #include "ObjectMgr.h" #include "OutdoorPvP.h" #include "SpellMgr.h" -#include "VMapManager2.h" #include "Player.h" +#include "World.h" namespace DisableMgr { @@ -193,28 +193,28 @@ void LoadDisables() switch (mapEntry->map_type) { case MAP_COMMON: - if (flags & VMAP_DISABLE_AREAFLAG) + if (flags & VMAP::VMAP_DISABLE_AREAFLAG) TC_LOG_INFO("misc", "Areaflag disabled for world map %u.", entry); - if (flags & VMAP_DISABLE_LIQUIDSTATUS) + if (flags & VMAP::VMAP_DISABLE_LIQUIDSTATUS) TC_LOG_INFO("misc", "Liquid status disabled for world map %u.", entry); break; case MAP_INSTANCE: case MAP_RAID: - if (flags & VMAP_DISABLE_HEIGHT) + if (flags & VMAP::VMAP_DISABLE_HEIGHT) TC_LOG_INFO("misc", "Height disabled for instance map %u.", entry); - if (flags & VMAP_DISABLE_LOS) + if (flags & VMAP::VMAP_DISABLE_LOS) TC_LOG_INFO("misc", "LoS disabled for instance map %u.", entry); break; case MAP_BATTLEGROUND: - if (flags & VMAP_DISABLE_HEIGHT) + if (flags & VMAP::VMAP_DISABLE_HEIGHT) TC_LOG_INFO("misc", "Height disabled for battleground map %u.", entry); - if (flags & VMAP_DISABLE_LOS) + if (flags & VMAP::VMAP_DISABLE_LOS) TC_LOG_INFO("misc", "LoS disabled for battleground map %u.", entry); break; case MAP_ARENA: - if (flags & VMAP_DISABLE_HEIGHT) + if (flags & VMAP::VMAP_DISABLE_HEIGHT) TC_LOG_INFO("misc", "Height disabled for arena map %u.", entry); - if (flags & VMAP_DISABLE_LOS) + if (flags & VMAP::VMAP_DISABLE_LOS) TC_LOG_INFO("misc", "LoS disabled for arena map %u.", entry); break; default: @@ -387,4 +387,15 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags return false; } +bool IsVMAPDisabledFor(uint32 entry, uint8 flags) +{ + return IsDisabledFor(DISABLE_TYPE_VMAP, entry, NULL, flags); +} + +bool IsPathfindingEnabled(uint32 mapId) +{ + return sWorld->getBoolConfig(CONFIG_ENABLE_MMAPS) + && !IsDisabledFor(DISABLE_TYPE_MMAP, mapId, NULL, MMAP_DISABLE_PATHFINDING); +} + } // Namespace diff --git a/src/server/game/Conditions/DisableMgr.h b/src/server/game/Conditions/DisableMgr.h index 0930da78547..f6c65abe90a 100644 --- a/src/server/game/Conditions/DisableMgr.h +++ b/src/server/game/Conditions/DisableMgr.h @@ -19,6 +19,7 @@ #ifndef TRINITY_DISABLEMGR_H #define TRINITY_DISABLEMGR_H +#include "VMapManager2.h" #include "Define.h" class Unit; @@ -49,14 +50,6 @@ enum SpellDisableTypes SPELL_DISABLE_LOS) }; -enum VmapDisableTypes -{ - VMAP_DISABLE_AREAFLAG = 0x1, - VMAP_DISABLE_HEIGHT = 0x2, - VMAP_DISABLE_LOS = 0x4, - VMAP_DISABLE_LIQUIDSTATUS = 0x8 -}; - enum MMapDisableTypes { MMAP_DISABLE_PATHFINDING = 0x0 @@ -67,6 +60,8 @@ namespace DisableMgr void LoadDisables(); bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags = 0); void CheckQuestDisables(); + bool IsVMAPDisabledFor(uint32 entry, uint8 flags); + bool IsPathfindingEnabled(uint32 mapId); } #endif //TRINITY_DISABLEMGR_H diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index ca8771dd0bb..37563acd74a 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -20,6 +20,7 @@ #include "Battleground.h" #include "MMapFactory.h" #include "CellImpl.h" +#include "DisableMgr.h" #include "DynamicTree.h" #include "GridNotifiers.h" #include "GridNotifiersImpl.h" @@ -119,7 +120,7 @@ bool Map::ExistVMap(uint32 mapid, int gx, int gy) void Map::LoadMMap(int gx, int gy) { - if (!MMAP::MMapFactory::IsPathfindingEnabled(GetId())) + if (!DisableMgr::IsPathfindingEnabled(GetId())) return; bool mmapLoadResult = MMAP::MMapFactory::createOrGetMMapManager()->loadMap((sWorld->GetDataPath() + "mmaps").c_str(), GetId(), gx, gy); diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index cbf88b68028..afd1f73c785 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -22,7 +22,7 @@ #include "MMapFactory.h" #include "MMapManager.h" #include "Log.h" - +#include "DisableMgr.h" #include "DetourCommon.h" #include "DetourNavMeshQuery.h" @@ -38,7 +38,7 @@ PathGenerator::PathGenerator(const Unit* owner) : TC_LOG_DEBUG("maps", "++ PathGenerator::PathGenerator for %u \n", _sourceUnit->GetGUIDLow()); uint32 mapId = _sourceUnit->GetMapId(); - if (MMAP::MMapFactory::IsPathfindingEnabled(mapId)) + if (DisableMgr::IsPathfindingEnabled(mapId)) { MMAP::MMapManager* mmap = MMAP::MMapFactory::createOrGetMMapManager(); _navMesh = mmap->GetNavMesh(mapId); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 903e14f7506..fae613797e9 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1283,6 +1283,13 @@ void World::SetInitialWorldSettings() ///- Initialize detour memory management dtAllocSetCustom(dtCustomAlloc, dtCustomFree); + ///- Initialize VMapManager function pointers (to untangle game/collision circular deps) + if (VMAP::VMapManager2* vmmgr2 = dynamic_cast(VMAP::VMapFactory::createOrGetVMapManager())) + { + vmmgr2->GetLiquidFlagsPtr = &GetLiquidFlags; + vmmgr2->IsVMAPDisabledForPtr = &DisableMgr::IsVMAPDisabledFor; + } + ///- Initialize config settings LoadConfigSettings(); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index b4b9928d6f8..a7716d3230b 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -35,6 +35,7 @@ #include "LFG.h" #include "GroupMgr.h" #include "MMapFactory.h" +#include "DisableMgr.h" class misc_commandscript : public CommandScript { @@ -186,7 +187,7 @@ public: uint32 haveMap = Map::ExistMap(mapId, gridX, gridY) ? 1 : 0; uint32 haveVMap = Map::ExistVMap(mapId, gridX, gridY) ? 1 : 0; - uint32 haveMMap = (MMAP::MMapFactory::IsPathfindingEnabled(mapId) && MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId())) ? 1 : 0; + uint32 haveMMap = (DisableMgr::IsPathfindingEnabled(mapId) && MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId())) ? 1 : 0; if (haveVMap) { diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp index 0be5994e8ed..bba14eb8332 100644 --- a/src/server/scripts/Commands/cs_mmaps.cpp +++ b/src/server/scripts/Commands/cs_mmaps.cpp @@ -25,6 +25,7 @@ #include "ScriptMgr.h" #include "Chat.h" +#include "DisableMgr.h" #include "ObjectMgr.h" #include "Player.h" #include "PointMovementGenerator.h" @@ -209,7 +210,7 @@ public: { uint32 mapId = handler->GetSession()->GetPlayer()->GetMapId(); handler->PSendSysMessage("mmap stats:"); - handler->PSendSysMessage(" global mmap pathfinding is %sabled", MMAP::MMapFactory::IsPathfindingEnabled(mapId) ? "en" : "dis"); + handler->PSendSysMessage(" global mmap pathfinding is %sabled", DisableMgr::IsPathfindingEnabled(mapId) ? "en" : "dis"); MMAP::MMapManager* manager = MMAP::MMapFactory::createOrGetMMapManager(); handler->PSendSysMessage(" %u maps loaded with %u tiles overall", manager->getLoadedMapsCount(), manager->getLoadedTilesCount()); diff --git a/src/tools/mmaps_generator/MapBuilder.cpp b/src/tools/mmaps_generator/MapBuilder.cpp index 885dd24d760..2f8b35fd52d 100644 --- a/src/tools/mmaps_generator/MapBuilder.cpp +++ b/src/tools/mmaps_generator/MapBuilder.cpp @@ -27,14 +27,6 @@ #include "DetourNavMesh.h" #include "DetourCommon.h" -#include "DisableMgr.h" - -uint32 GetLiquidFlags(uint32 /*liquidType*/) { return 0; } -namespace DisableMgr -{ - bool IsDisabledFor(DisableType /*type*/, uint32 /*entry*/, Unit const* /*unit*/, uint8 /*flags*/ /*= 0*/) { return false; } -} - #define MMAP_MAGIC 0x4d4d4150 // 'MMAP' #define MMAP_VERSION 5 diff --git a/src/tools/mmaps_generator/PathCommon.h b/src/tools/mmaps_generator/PathCommon.h index 8285fef74f2..694e40dacde 100644 --- a/src/tools/mmaps_generator/PathCommon.h +++ b/src/tools/mmaps_generator/PathCommon.h @@ -62,7 +62,7 @@ namespace MMAP if (*++filter == '\0') // wildcard at end of filter means all remaing chars match return true; - while (true) + for (;;) { if (*filter == *str) break; -- cgit v1.2.3