Core/Spells: Named and implemented most of SpellAttr8

This commit is contained in:
Shauren authored and Ovahlord committed 2023-10-23 18:07:05 +02:00
1 parent 1dfe0f0974
commit 388c504047
14 files changed
+248 -153

No files matched your search

+6 -3
View File
@@ -3103,7 +3103,10 @@ bool WorldObject::IsValidAttackTarget(WorldObject const* target, SpellInfo const
// PvP case - can't attack when attacker or target are in sanctuary
// however, 13850 client doesn't allow to attack when one of the unit's has sanctuary flag and is pvp
if (unitTarget && unitTarget->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED) && unitOrOwner && unitOrOwner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED) && (unitTarget->IsInSanctuary() || unitOrOwner->IsInSanctuary()))
if (unitTarget && unitTarget->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED)
&& unitOrOwner && unitOrOwner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED)
&& (unitTarget->IsInSanctuary() || unitOrOwner->IsInSanctuary())
&& (!bySpell || bySpell->HasAttribute(SPELL_ATTR8_IGNORE_SANCTUARY)))
return false;
// additional checks - only PvP case
@@ -3206,8 +3209,8 @@ bool WorldObject::IsValidAssistTarget(WorldObject const* target, SpellInfo const
return false;
// can't assist player out of sanctuary from sanctuary if has pvp enabled
if (unitTarget->IsPvP())
if (unit && unit->IsInSanctuary() && !unitTarget->IsInSanctuary())
if (unitTarget->IsPvP() && (!bySpell || bySpell->HasAttribute(SPELL_ATTR8_IGNORE_SANCTUARY)))
if (unit->IsInSanctuary() && !unitTarget->IsInSanctuary())
return false;
}
}