Core/Spells: Fix an incorrect check that was exempting negative spells from _IMMUNE_TO_x checks. Closes #21929.

This commit is contained in:
Treeston
2018-08-28 19:42:18 +02:00
parent 829527a08e
commit 75e7404bba
2 changed files with 3 additions and 2 deletions

View File

@@ -2884,7 +2884,7 @@ bool WorldObject::IsValidAttackTarget(WorldObject const* target, SpellInfo const
return false;
// ignore immunity flags when assisting
if (!bySpell || (isPositiveSpell && !bySpell->HasAttribute(SPELL_ATTR6_ASSIST_IGNORE_IMMUNE_FLAG)))
if (!bySpell || !(isPositiveSpell && bySpell->HasAttribute(SPELL_ATTR6_ASSIST_IGNORE_IMMUNE_FLAG)))
{
if (unit && !unit->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED) && unitTarget && unitTarget->IsImmuneToNPC())
return false;

View File

@@ -340,7 +340,8 @@ enum ReactStates
REACT_DEFENSIVE = 1,
REACT_AGGRESSIVE = 2
};
inline char const* DescribeReactState(ReactStates state) {
inline char const* DescribeReactState(ReactStates state)
{
switch (state)
{
case REACT_PASSIVE: return "PASSIVE";