Core/Spells: Make GMs and vehicle riders not attackable by AOE again.

This commit is contained in:
QAston
2011-08-24 18:22:33 +02:00
parent 2fa6b23be9
commit 7a3b1f1ed5
2 changed files with 4 additions and 2 deletions
+2
View File
@@ -706,6 +706,8 @@ namespace Trinity
// can't be checked in SpellInfo::CheckTarget - needs more research // can't be checked in SpellInfo::CheckTarget - needs more research
if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE)) if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
continue; continue;
if (target->HasUnitState(UNIT_STAT_UNATTACKABLE))
continue;
if (i_source->IsControlledByPlayer()) if (i_source->IsControlledByPlayer())
{ {
if (i_source->IsFriendlyTo(target)) if (i_source->IsFriendlyTo(target))
+2 -2
View File
@@ -1639,8 +1639,8 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, Unit const* target, b
return SPELL_FAILED_BAD_TARGETS; return SPELL_FAILED_BAD_TARGETS;
} }
// check GM mode and GM invisibility - only for player casts (npc casts are controlled by AI) // check GM mode and GM invisibility - only for player casts (npc casts are controlled by AI) and negative spells
if (target != caster && caster->IsControlledByPlayer() && target->GetTypeId() == TYPEID_PLAYER) if (target != caster && (caster->IsControlledByPlayer() || !IsPositive()) && target->GetTypeId() == TYPEID_PLAYER)
{ {
if (!target->ToPlayer()->IsVisible()) if (!target->ToPlayer()->IsVisible())
return SPELL_FAILED_BAD_TARGETS; return SPELL_FAILED_BAD_TARGETS;