Core/Spells: Make core be a little less strict about some spell attributes SPELL_ATTR0_CASTABLE_WHILE_DEAD and SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS checks.

This commit is contained in:
QAston
2011-08-30 00:13:53 +02:00
parent 5708bc8b1e
commit d863562507
+2 -2
View File
@@ -4577,7 +4577,7 @@ void Spell::HandleEffects(Unit *pUnitTarget, Item *pItemTarget, GameObject *pGOT
SpellCastResult Spell::CheckCast(bool strict)
{
// check death state
if (!m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR0_PASSIVE) && !(m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_DEAD))
if (!m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR0_PASSIVE) && !((m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_DEAD) || (IsTriggered() && !m_triggeredByAuraSpell)))
return SPELL_FAILED_CASTER_DEAD;
// check cooldowns to prevent cheating
@@ -6376,7 +6376,7 @@ bool Spell::CheckEffectTarget(Unit const* target, uint32 eff) const
break;
}
if (m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS)
if (IsTriggered() || m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS)
return true;
// todo: shit below shouldn't be here, but it's temporary