Core/Loot: fix some other cases where a creature should not be able to set focus. (#23415)

(cherry picked from commit d50be8e020)
This commit is contained in:
Wyrserth
2019-06-16 19:27:53 +02:00
committed by Shauren
parent 441e08869e
commit 3278f87789

View File

@@ -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