mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-14 05:59:29 +01:00
Core/Spells: Don't allow most spells to be casted while dead
--HG-- branch : trunk
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user