mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Fix get zone id
This commit is contained in:
@@ -1537,6 +1537,7 @@ void RandomPlayerbotMgr::PrepareTeleportCache()
|
|||||||
if (!map)
|
if (!map)
|
||||||
continue;
|
continue;
|
||||||
const AreaTableEntry* area = sAreaTableStore.LookupEntry(map->GetAreaId(1, x, y, z));
|
const AreaTableEntry* area = sAreaTableStore.LookupEntry(map->GetAreaId(1, x, y, z));
|
||||||
|
uint32 zoneId = area->zone ? area->zone : area->ID;
|
||||||
uint32 level = area->area_level;
|
uint32 level = area->area_level;
|
||||||
for (int i = 5; i <= maxLevel; i++)
|
for (int i = 5; i <= maxLevel; i++)
|
||||||
{
|
{
|
||||||
@@ -1550,14 +1551,15 @@ void RandomPlayerbotMgr::PrepareTeleportCache()
|
|||||||
|
|
||||||
if (loc.GetExactDist(checkLoc) > 1000.0f)
|
if (loc.GetExactDist(checkLoc) > 1000.0f)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (area->zone !=
|
if (zoneId !=
|
||||||
map->GetZoneId(1, checkLoc.GetPositionX(), checkLoc.GetPositionY(), checkLoc.GetPositionZ()))
|
map->GetZoneId(1, checkLoc.GetPositionX(), checkLoc.GetPositionY(), checkLoc.GetPositionZ()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
counter++;
|
counter++;
|
||||||
levelLoc = checkLoc;
|
levelLoc = checkLoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (counter < 15)
|
if (counter < 15)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user