Core/Spells: Make GMs and vehicle riders not attackable by AOE again.
This commit is contained in:
@@ -706,6 +706,8 @@ namespace Trinity
|
||||
// can't be checked in SpellInfo::CheckTarget - needs more research
|
||||
if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
|
||||
continue;
|
||||
if (target->HasUnitState(UNIT_STAT_UNATTACKABLE))
|
||||
continue;
|
||||
if (i_source->IsControlledByPlayer())
|
||||
{
|
||||
if (i_source->IsFriendlyTo(target))
|
||||
|
||||
@@ -1639,8 +1639,8 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, Unit const* target, b
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
|
||||
// check GM mode and GM invisibility - only for player casts (npc casts are controlled by AI)
|
||||
if (target != caster && caster->IsControlledByPlayer() && target->GetTypeId() == TYPEID_PLAYER)
|
||||
// check GM mode and GM invisibility - only for player casts (npc casts are controlled by AI) and negative spells
|
||||
if (target != caster && (caster->IsControlledByPlayer() || !IsPositive()) && target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (!target->ToPlayer()->IsVisible())
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
Reference in New Issue
Block a user