Game/AI: Implement ContactDistance for ACTION_MOVE_TO_POS (#18720)

(cherry-picked from 60d1c0e20d3f8f32de81bff047531b927e586a97)
This commit is contained in:
Rushor
2018-12-09 14:18:42 +01:00
committed by Shauren
parent 0764ac47e0
commit 77cb6c1a3f
2 changed files with 9 additions and 2 deletions
@@ -1707,7 +1707,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, dest, e.action.MoveToPos.disablePathfinding == 0);
}
else
me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), e.action.MoveToPos.disablePathfinding == 0);
{
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);
me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, x, y, z, e.action.MoveToPos.disablePathfinding == 0);
}
break;
}
case SMART_ACTION_RESPAWN_TARGET: