fix(Core/SmartAI): Prevent MOVE_TO_POS from creating large distances between target (#15899)
Update SmartScript.cpp
This commit is contained in:
parent
9c6a561404
commit
fd6941de7c
1 changed files with 3 additions and 1 deletions
|
|
@ -1635,7 +1635,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
float x, y, z;
|
||||
target->GetPosition(x, y, z);
|
||||
if (e.action.moveToPos.ContactDistance > 0)
|
||||
target->GetContactPoint(me, x, y, z, e.action.moveToPos.ContactDistance);
|
||||
{
|
||||
target->GetNearPoint(me, x, y, z, e.action.moveToPos.ContactDistance, 0, target->GetAngle(me));
|
||||
}
|
||||
me->GetMotionMaster()->MovePoint(e.action.moveToPos.pointId, x + e.target.x, y + e.target.y, z + e.target.z, true, true, isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue