mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
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:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user