diff options
author | Wyrserth <43747507+Wyrserth@users.noreply.github.com> | 2019-06-16 19:27:53 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-11 14:12:54 +0100 |
commit | 3278f87789b8357ce888ab61026c0ca6daa8e6cb (patch) | |
tree | c4c730bee850a82218d2e5a9b472c4cf37179402 | |
parent | 441e08869eb656a1653ab94147c05be35125d176 (diff) |
Core/Loot: fix some other cases where a creature should not be able to set focus. (#23415)
(cherry picked from commit d50be8e020c235617cae6d85e214794c164a73c9)
-rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 3a0516ed6fa..bcda4c972f1 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -546,7 +546,7 @@ bool Creature::InitEntry(uint32 entry, CreatureData const* data /*= nullptr*/) LoadEquipment(); // use default equipment (if available) for summons else if (data->equipmentId == 0) LoadEquipment(0); // 0 means no equipment for creature table - else + else { m_originalEquipmentId = data->equipmentId; LoadEquipment(data->equipmentId); @@ -3175,8 +3175,12 @@ void Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target) if (m_focusSpell) return; - // Prevent dead creatures from setting a focus target, so they won't turn - if (!IsAlive()) + // Prevent dead/feigning death creatures from setting a focus target, so they won't turn + if (!IsAlive() || HasUnitFlag2(UNIT_FLAG2_FEIGN_DEATH) || HasAuraType(SPELL_AURA_FEIGN_DEATH)) + return; + + // Don't allow stunned creatures to set a focus target + if (HasUnitFlag(UNIT_FLAG_STUNNED)) return; // some spells shouldn't track targets |