Core/AI: merged walk / run fix for EscortAI

This commit is contained in:
Ovahlord
2018-08-20 02:53:42 +02:00
parent f95d9d0599
commit c4ce03f525
2 changed files with 12 additions and 4 deletions

View File

@@ -353,10 +353,13 @@ void EscortAI::FillPointMovementListForCreature()
void EscortAI::SetRun(bool on)
{
if (on && !_running)
me->SetWalk(false);
else if (!on && _running)
me->SetWalk(true);
if (on == _running)
return;
for (auto& node : _path.nodes)
node.moveType = on ? WAYPOINT_MOVE_TYPE_RUN : WAYPOINT_MOVE_TYPE_WALK;
me->SetWalk(!on);
_running = on;
}

View File

@@ -799,8 +799,13 @@ ObjectGuid SmartAI::GetGUID(int32 /*id*/) const
void SmartAI::SetRun(bool run)
{
if (run == mRun)
return;
me->SetWalk(!run);
mRun = run;
for (auto& node : _path.nodes)
node.moveType = run ? WAYPOINT_MOVE_TYPE_RUN : WAYPOINT_MOVE_TYPE_WALK;
}
void SmartAI::SetDisableGravity(bool fly)