mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-07 21:01:37 +00:00
SmartAI: Fix npcs not waypointing when offset is too big (#23453)
This commit is contained in:
@@ -157,15 +157,14 @@ void SmartAI::GenerateWayPointArray(Movement::PointsArray* points)
|
|||||||
pVector.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
|
pVector.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
|
||||||
uint32 wpCounter = mCurrentWPID;
|
uint32 wpCounter = mCurrentWPID;
|
||||||
|
|
||||||
auto itr = mWayPoints->find(wpCounter++);
|
uint32 length = (mWayPoints->size() - mCurrentWPID) * size;
|
||||||
do
|
|
||||||
|
uint32 cnt = 0;
|
||||||
|
for (auto itr = mWayPoints->find(wpCounter); itr != mWayPoints->end() && cnt++ <= length; ++itr)
|
||||||
{
|
{
|
||||||
WaypointData const& wp = (*itr).second;
|
WaypointData const& wp = (*itr).second;
|
||||||
pVector.push_back(G3D::Vector3(wp.x, wp.y, wp.z));
|
pVector.push_back(G3D::Vector3(wp.x, wp.y, wp.z));
|
||||||
|
|
||||||
itr = mWayPoints->find(wpCounter++);
|
|
||||||
}
|
}
|
||||||
while (itr != mWayPoints->end());
|
|
||||||
|
|
||||||
if (pVector.size() > 2) // more than source + dest
|
if (pVector.size() > 2) // more than source + dest
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user