Core/Misc: remove incorrect ClearUnitState calls related to movement

these unit states should never be removed outside motionmaster's handlings

(cherry picked from commit 79b90f9d3afb3815e265fc59a1e98c92ec788012)
This commit is contained in:
ccrs
2021-12-05 18:37:12 +01:00
committed by Shauren
parent 0af20f5753
commit c511fa2803
2 changed files with 1 additions and 16 deletions
@@ -52,19 +52,7 @@ void FollowerAI::MovementInform(uint32 type, uint32 id)
void FollowerAI::AttackStart(Unit* who)
{
if (!who)
return;
if (me->Attack(who, true))
{
me->EngageWithTarget(who); // in case it doesn't have threat+combat yet
if (me->HasUnitState(UNIT_STATE_FOLLOW))
me->ClearUnitState(UNIT_STATE_FOLLOW);
if (IsCombatMovementAllowed())
me->GetMotionMaster()->MoveChase(who);
}
ScriptedAI::AttackStart(who);
}
void FollowerAI::MoveInLineOfSight(Unit* who)
-3
View File
@@ -195,7 +195,6 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
if (!owner->IsValidAttackTarget(TargetUnit))
return;
pet->ClearUnitState(UNIT_STATE_FOLLOW);
// This is true if pet has no target or has target but targets differs.
if (pet->GetVictim() != TargetUnit || !pet->GetCharmInfo()->IsCommandAttack())
{
@@ -695,8 +694,6 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPackets::Spells::PetCastSpell&
SpellCastTargets targets(caster, petCastSpell.Cast);
caster->ClearUnitState(UNIT_STATE_FOLLOW);
Spell* spell = new Spell(caster, spellInfo, TRIGGERED_NONE);
spell->m_fromClient = true;
spell->m_misc.Raw.Data[0] = petCastSpell.Cast.Misc[0];