aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-23 16:13:30 -0600
committermegamage <none@none>2009-03-23 16:13:30 -0600
commite9fb303e362717b848b3cda10e69f44eb9791399 (patch)
treeef20e19bc20623518279f9306bee1145e27c40a4 /src
parent2c6e5a4b239b7f2cae092f3549827b6201769688 (diff)
*Fix a crash in CanCast.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Spell.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 0e0f127a127..3028e48deac 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -4212,13 +4212,11 @@ SpellCastResult Spell::CheckCast(bool strict)
{
if(m_caster->GetPetGUID()) //let warlock do a replacement summon
{
-
- Pet* pet = ((Player*)m_caster)->GetPet();
-
if (m_caster->GetTypeId()==TYPEID_PLAYER && m_caster->getClass()==CLASS_WARLOCK)
{
if (strict) //starting cast, trigger pet stun (cast by pet so it doesn't attack player)
- pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetGUID());
+ if(Pet* pet = m_caster->GetPet())
+ pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetGUID());
}
else
return SPELL_FAILED_ALREADY_HAVE_SUMMON;