From 9b41798eee423ef75b3991f6526aa141a848e260 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sat, 14 Dec 2024 22:29:31 +0800 Subject: [PATCH] Fix get zone id --- src/RandomPlayerbotMgr.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/RandomPlayerbotMgr.cpp b/src/RandomPlayerbotMgr.cpp index d135b55c..407f5323 100644 --- a/src/RandomPlayerbotMgr.cpp +++ b/src/RandomPlayerbotMgr.cpp @@ -1537,6 +1537,7 @@ void RandomPlayerbotMgr::PrepareTeleportCache() if (!map) continue; const AreaTableEntry* area = sAreaTableStore.LookupEntry(map->GetAreaId(1, x, y, z)); + uint32 zoneId = area->zone ? area->zone : area->ID; uint32 level = area->area_level; for (int i = 5; i <= maxLevel; i++) { @@ -1550,14 +1551,15 @@ void RandomPlayerbotMgr::PrepareTeleportCache() if (loc.GetExactDist(checkLoc) > 1000.0f) continue; - - if (area->zone != + + if (zoneId != map->GetZoneId(1, checkLoc.GetPositionX(), checkLoc.GetPositionY(), checkLoc.GetPositionZ())) continue; counter++; levelLoc = checkLoc; } + if (counter < 15) continue;