mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
fix(Core/Debug): Inline zone filter in showpath cmd — GetNodesInZone was removed
This commit is contained in:
parent
9da99163a8
commit
59d9bc6f78
@ -16,6 +16,7 @@
|
||||
#include "BattleGroundTactics.h"
|
||||
#include "Chat.h"
|
||||
#include "GuildTaskMgr.h"
|
||||
#include "MapMgr.h"
|
||||
#include "PerfMonitor.h"
|
||||
#include "PlayerbotMgr.h"
|
||||
#include "RandomPlayerbotMgr.h"
|
||||
@ -186,7 +187,24 @@ public:
|
||||
}
|
||||
|
||||
uint32 zoneId = player->GetZoneId();
|
||||
std::vector<TravelNode*> const& nodes = sTravelNodeMap.GetNodesInZone(zoneId);
|
||||
uint32 const phaseMask = player->GetPhaseMask();
|
||||
uint32 const mapId = player->GetMapId();
|
||||
std::vector<TravelNode*> nodes;
|
||||
for (TravelNode* n : sTravelNodeMap.getNodes())
|
||||
{
|
||||
if (!n)
|
||||
continue;
|
||||
WorldPosition* pos = n->getPosition();
|
||||
if (!pos || pos->GetMapId() != mapId)
|
||||
continue;
|
||||
uint32 const nodeZone = sMapMgr->GetZoneId(phaseMask, mapId,
|
||||
pos->GetPositionX(),
|
||||
pos->GetPositionY(),
|
||||
pos->GetPositionZ());
|
||||
if (nodeZone != zoneId)
|
||||
continue;
|
||||
nodes.push_back(n);
|
||||
}
|
||||
if (nodes.empty())
|
||||
{
|
||||
handler->PSendSysMessage("No travel nodes registered in zone {} (is the travel node system loaded?)", zoneId);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user