aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWyrserth <43747507+Wyrserth@users.noreply.github.com>2019-06-16 19:27:53 +0200
committerGiacomo Pozzoni <giacomopoz@gmail.com>2019-06-16 19:27:53 +0200
commitd50be8e020c235617cae6d85e214794c164a73c9 (patch)
tree17ecdbb812455ad3c0af79de586daef6a775c51c /src
parent5c019db6a7d91e10eb074e8776620527796a3b46 (diff)
Core/Loot: fix some other cases where a creature should not be able to set focus. (#23415)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 9d57c5801bc..27b792afd7e 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -3011,8 +3011,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() || HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH) || HasAuraType(SPELL_AURA_FEIGN_DEATH))
+ return;
+
+ // Don't allow stunned creatures to set a focus target
+ if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED))
return;
// some spells shouldn't track targets