From ce0add2121222f362537fff3f680d32cd55afe02 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sat, 9 Mar 2013 22:19:14 +0100 Subject: Core/Commands: Add mmaps check for command .gps --- src/server/scripts/Commands/cs_misc.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 20c50949dcc..c6d80cea3a5 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -35,6 +35,7 @@ #include "Pet.h" #include "LFG.h" #include "GroupMgr.h" +#include "MMapFactory.h" class misc_commandscript : public CommandScript { @@ -191,8 +192,9 @@ public: uint32 zoneId, areaId; object->GetZoneAndAreaId(zoneId, areaId); + uint32 mapId = object->GetMapId(); - MapEntry const* mapEntry = sMapStore.LookupEntry(object->GetMapId()); + MapEntry const* mapEntry = sMapStore.LookupEntry(mapId); AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zoneId); AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaId); @@ -211,8 +213,9 @@ public: int gridX = 63 - gridCoord.x_coord; int gridY = 63 - gridCoord.y_coord; - uint32 haveMap = Map::ExistMap(object->GetMapId(), gridX, gridY) ? 1 : 0; - uint32 haveVMap = Map::ExistVMap(object->GetMapId(), gridX, gridY) ? 1 : 0; + 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; if (haveVMap) { @@ -225,13 +228,13 @@ public: handler->PSendSysMessage("no VMAP available for area info"); handler->PSendSysMessage(LANG_MAP_POSITION, - object->GetMapId(), (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : ""), + mapId, (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : ""), zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : ""), areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : ""), object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(), cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(), - zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap); + zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap, haveMMap); LiquidData liquidStatus; ZLiquidStatus status = map->getLiquidStatus(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus); -- cgit v1.2.3