mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 07:48:02 +00:00
fix(Core/SmartAI): Prevent MOVE_TO_POS from creating large distances between target (#15899)
Update SmartScript.cpp
This commit is contained in:
@@ -1635,7 +1635,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||||||
float x, y, z;
|
float x, y, z;
|
||||||
target->GetPosition(x, y, z);
|
target->GetPosition(x, y, z);
|
||||||
if (e.action.moveToPos.ContactDistance > 0)
|
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);
|
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;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user