Core/Spells: Don't allow most spells to be casted while dead

--HG--
branch : trunk
This commit is contained in:
Shocker
2010-09-08 07:01:55 +03:00
parent fd52f7b202
commit 01c2a6d87c

View File

@@ -4701,6 +4701,10 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar
SpellCastResult Spell::CheckCast(bool strict)
{
// check death state
if (!m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR_PASSIVE) && !(m_spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_DEAD))
return SPELL_FAILED_CASTER_DEAD;
// check cooldowns to prevent cheating
if (m_caster->GetTypeId() == TYPEID_PLAYER && !(m_spellInfo->Attributes & SPELL_ATTR_PASSIVE))
{