Core/Misc: remove incorrect ClearUnitState calls related to movement

these unit states should never be removed outside motionmaster's handlings
This commit is contained in:
ccrs
2019-05-16 00:21:09 +02:00
parent 6d2d16727a
commit 79b90f9d3a
2 changed files with 1 additions and 16 deletions

View File

@@ -53,19 +53,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)

View File

@@ -202,7 +202,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())
{
@@ -802,8 +801,6 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
targets.Read(recvPacket, caster);
HandleClientCastFlags(recvPacket, castFlags, targets);
caster->ClearUnitState(UNIT_STATE_FOLLOW);
Spell* spell = new Spell(caster, spellInfo, TRIGGERED_NONE);
spell->m_cast_count = castCount; // probably pending spell cast
spell->m_targets = targets;