mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-19 14:39:43 -04:00
Core/Pets: Fixed flashing pet attack button (#18906)
(cherrypicked from 0fa38d0ae0)
This commit is contained in:
@@ -5605,6 +5605,10 @@ void Unit::CombatStop(bool includingCast)
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
ToPlayer()->SendAttackSwingCancelAttack(); // melee and ranged forced attack cancel
|
||||
ClearInCombat();
|
||||
|
||||
// just in case
|
||||
if (IsPetInCombat() && GetTypeId() != TYPEID_PLAYER)
|
||||
ClearInPetCombat();
|
||||
}
|
||||
|
||||
void Unit::CombatStopWithPets(bool includingCast)
|
||||
@@ -7804,10 +7808,12 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
|
||||
Dismount();
|
||||
}
|
||||
|
||||
for (Unit::ControlList::iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
|
||||
for (Unit::ControlList::iterator itr = m_Controlled.begin(); itr != m_Controlled.end();)
|
||||
{
|
||||
(*itr)->SetInCombatState(PvP, enemy);
|
||||
(*itr)->AddUnitFlag(UNIT_FLAG_PET_IN_COMBAT);
|
||||
Unit* controlled = *itr;
|
||||
++itr;
|
||||
|
||||
controlled->SetInCombatState(PvP, enemy);
|
||||
}
|
||||
|
||||
ProcSkillsAndAuras(enemy, PROC_FLAG_ENTER_COMBAT, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_NONE, PROC_HIT_NONE, nullptr, nullptr, nullptr);
|
||||
@@ -7838,10 +7844,16 @@ void Unit::ClearInCombat()
|
||||
else
|
||||
ToPlayer()->OnCombatExit();
|
||||
|
||||
RemoveUnitFlag(UNIT_FLAG_PET_IN_COMBAT);
|
||||
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_LEAVE_COMBAT);
|
||||
}
|
||||
|
||||
void Unit::ClearInPetCombat()
|
||||
{
|
||||
RemoveUnitFlag(UNIT_FLAG_PET_IN_COMBAT);
|
||||
if (Unit* owner = GetOwner())
|
||||
owner->RemoveUnitFlag(UNIT_FLAG_PET_IN_COMBAT);
|
||||
}
|
||||
|
||||
bool Unit::isTargetableForAttack(bool checkFakeDeath) const
|
||||
{
|
||||
if (!IsAlive())
|
||||
|
||||
Reference in New Issue
Block a user