Core/Handlers: apply some movement related corrections

Port From (https://github.com/TrinityCore/TrinityCore/commit/476566871879abe51a48833a01cec427dd7c6b8e)
This commit is contained in:
hondacrx
2021-12-07 20:14:31 -05:00
parent 67acfe01c5
commit d5735d68d3
+4 -8
View File
@@ -139,9 +139,8 @@ namespace Game
case ActiveStates.Command: //0x07
switch ((CommandStates)spellid)
{
case CommandStates.Stay: //flat=1792 //STAY
pet.StopMoving();
pet.GetMotionMaster().Clear();
case CommandStates.Stay: // flat = 1792 //STAY
pet.GetMotionMaster().Clear(MovementGeneratorPriority.Normal);
pet.GetMotionMaster().MoveIdle();
charmInfo.SetCommandState(CommandStates.Stay);
@@ -152,7 +151,7 @@ namespace Game
charmInfo.SetIsReturning(false);
charmInfo.SaveStayPosition();
break;
case CommandStates.Follow: //spellid=1792 //FOLLOW
case CommandStates.Follow: // spellid = 1792 //FOLLOW
pet.AttackStop();
pet.InterruptNonMeleeSpells(false);
pet.GetMotionMaster().MoveFollow(GetPlayer(), SharedConst.PetFollowDist, pet.GetFollowAngle());
@@ -164,7 +163,7 @@ namespace Game
charmInfo.SetIsCommandFollow(true);
charmInfo.SetIsFollowing(false);
break;
case CommandStates.Attack: //spellid=1792 //ATTACK
case CommandStates.Attack: // spellid = 1792 //ATTACK
{
// Can't attack if owner is pacified
if (GetPlayer().HasAuraType(AuraType.ModPacify))
@@ -183,7 +182,6 @@ namespace Game
if (!owner.IsValidAttackTarget(TargetUnit))
return;
pet.ClearUnitState(UnitState.Follow);
// This is true if pet has no target or has target but targets differs.
if (pet.GetVictim() != TargetUnit || !pet.GetCharmInfo().IsCommandAttack())
{
@@ -367,7 +365,6 @@ namespace Game
// This is true if pet has no target or has target but targets differs.
if (pet.GetVictim() != unit_target)
{
pet.GetMotionMaster().Clear();
CreatureAI ai = pet.ToCreature().GetAI();
if (ai != null)
{
@@ -686,7 +683,6 @@ namespace Game
return;
SpellCastTargets targets = new(caster, petCastSpell.Cast);
caster.ClearUnitState(UnitState.Follow);
Spell spell = new(caster, spellInfo, TriggerCastFlags.None);
spell.m_fromClient = true;