Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good.
Port From (https://github.com/TrinityCore/TrinityCore/commit/bc89e1cdb0da10e53cc9fa4a97565c05bb4c052e)
This commit is contained in:
@@ -158,7 +158,7 @@ namespace Game.AI
|
||||
// Face the unit (stealthed player) and set distracted state for 5 seconds
|
||||
me.GetMotionMaster().MoveDistract(5 * Time.InMilliseconds);
|
||||
me.StopMoving();
|
||||
me.SetFacingTo(me.GetAngle(who));
|
||||
me.SetFacingTo(me.GetAbsoluteAngle(who));
|
||||
}
|
||||
|
||||
// Called for reaction at stopping attack at no attackers or targets
|
||||
|
||||
@@ -1296,7 +1296,7 @@ namespace Game.AI
|
||||
|
||||
if (me.IsStopped() && !me.HasUnitState(UnitState.CannotTurn))
|
||||
{
|
||||
float targetAngle = me.GetAngle(target);
|
||||
float targetAngle = me.GetAbsoluteAngle(target);
|
||||
if (_forceFacing || Math.Abs(me.GetOrientation() - targetAngle) > 0.4f)
|
||||
{
|
||||
me.SetFacingTo(targetAngle);
|
||||
|
||||
Reference in New Issue
Block a user