aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 3c44df10cb9..848895306da 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2032,6 +2032,24 @@ void Spell::prepare(SpellCastTargets * targets, Aura* triggeredByAura)
return;
}
+ if(m_caster->GetTypeId() == TYPEID_PLAYER || (m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->isPet()))
+ {
+ if(objmgr.IsPlayerSpellDisabled(m_spellInfo->Id))
+ {
+ SendCastResult(SPELL_FAILED_SPELL_UNAVAILABLE);
+ finish(false);
+ return;
+ }
+ }
+ else
+ {
+ if(objmgr.IsCreatureSpellDisabled(m_spellInfo->Id))
+ {
+ finish(false);
+ return;
+ }
+ }
+
// Fill cost data
m_powerCost = CalculatePowerCost();