mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 11:52:32 +01:00
Core/Pets: Fixed flashing pet attack button (#18906)
(cherrypicked from 0fa38d0ae0)
This commit is contained in:
@@ -2046,16 +2046,9 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
|
||||
// creature/player specific target checks
|
||||
if (unitTarget)
|
||||
{
|
||||
if (HasAttribute(SPELL_ATTR1_CANT_TARGET_IN_COMBAT))
|
||||
{
|
||||
if (unitTarget->IsInCombat())
|
||||
return SPELL_FAILED_TARGET_AFFECTING_COMBAT;
|
||||
// player with active pet counts as a player in combat
|
||||
else if (Player const* player = unitTarget->ToPlayer())
|
||||
if (Pet* pet = player->GetPet())
|
||||
if (pet->GetVictim() && !pet->HasUnitState(UNIT_STATE_CONTROLLED))
|
||||
return SPELL_FAILED_TARGET_AFFECTING_COMBAT;
|
||||
}
|
||||
// spells cannot be cast if player is in fake combat also
|
||||
if (HasAttribute(SPELL_ATTR1_CANT_TARGET_IN_COMBAT) && (unitTarget->IsInCombat() || unitTarget->IsPetInCombat()))
|
||||
return SPELL_FAILED_TARGET_AFFECTING_COMBAT;
|
||||
|
||||
// only spells with SPELL_ATTR3_ONLY_TARGET_GHOSTS can target ghosts
|
||||
if (HasAttribute(SPELL_ATTR3_ONLY_TARGET_GHOSTS) != unitTarget->HasAuraType(SPELL_AURA_GHOST))
|
||||
|
||||
Reference in New Issue
Block a user