aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShocker <none@none>2010-09-08 07:01:55 +0300
committerShocker <none@none>2010-09-08 07:01:55 +0300
commit01c2a6d87c1ebb95a49bc9fa0c45312b93e189be (patch)
tree3c661ea58c9085be96ca523abe2c1b21fa6e5e11
parentfd52f7b202b2be285a612d11121cbed9debdb903 (diff)
Core/Spells: Don't allow most spells to be casted while dead
--HG-- branch : trunk
-rw-r--r--src/server/game/Spells/Spell.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 09eb0c4f710..bb2d38aca6d 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -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))
{