Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good.
Port From (https://github.com/TrinityCore/TrinityCore/commit/bc89e1cdb0da10e53cc9fa4a97565c05bb4c052e)
This commit is contained in:
@@ -8332,25 +8332,22 @@ namespace Game.Spells
|
||||
|
||||
public class WorldObjectSpellLineTargetCheck : WorldObjectSpellAreaTargetCheck
|
||||
{
|
||||
Position _srcPosition;
|
||||
Position _dstPosition;
|
||||
Position _position;
|
||||
float _lineWidth;
|
||||
|
||||
public WorldObjectSpellLineTargetCheck(Position srcPosition, Position dstPosition, float lineWidth, float range, WorldObject caster, SpellInfo spellInfo, SpellTargetCheckTypes selectionType, List<Condition> condList, SpellTargetObjectTypes objectType)
|
||||
: base(range, caster, caster, caster, spellInfo, selectionType, condList, objectType)
|
||||
{
|
||||
_srcPosition = srcPosition;
|
||||
_dstPosition = dstPosition;
|
||||
_position = srcPosition;
|
||||
_lineWidth = lineWidth;
|
||||
|
||||
if (dstPosition != null && srcPosition != dstPosition)
|
||||
_position.SetOrientation(srcPosition.GetAbsoluteAngle(dstPosition));
|
||||
}
|
||||
|
||||
public override bool Invoke(WorldObject target)
|
||||
{
|
||||
float angle = _caster.GetOrientation();
|
||||
if (_srcPosition != _dstPosition)
|
||||
angle = _srcPosition.GetAngle(_dstPosition);
|
||||
|
||||
if (!_caster.HasInLine(target, target.GetCombatReach(), _lineWidth, angle))
|
||||
if (!_position.HasInLine(target, target.GetCombatReach(), _lineWidth))
|
||||
return false;
|
||||
|
||||
return base.Invoke(target);
|
||||
|
||||
@@ -1927,7 +1927,7 @@ namespace Game.Spells
|
||||
unitTarget.GetMotionMaster().MoveDistract((uint)(damage * Time.InMilliseconds));
|
||||
|
||||
unitTarget.StopMoving();
|
||||
unitTarget.SetFacingTo(unitTarget.GetAngle(destTarget));
|
||||
unitTarget.SetFacingTo(unitTarget.GetAbsoluteAngle(destTarget));
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.Pickpocket)]
|
||||
@@ -4863,7 +4863,7 @@ namespace Game.Spells
|
||||
summon.SetFaction(unitCaster.GetFaction());
|
||||
|
||||
if (summon.HasUnitTypeMask(UnitTypeMask.Minion) && m_targets.HasDst())
|
||||
((Minion)summon).SetFollowAngle(unitCaster.GetAngle(summon.GetPosition()));
|
||||
((Minion)summon).SetFollowAngle(unitCaster.GetAbsoluteAngle(summon.GetPosition()));
|
||||
|
||||
if (summon.GetEntry() == 27893)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user