From 7c4f2f520f4047b10d94e44f6af1c910ff4bdbcf Mon Sep 17 00:00:00 2001 From: "malcromdev@gmail.com>" Date: Thu, 1 Apr 2010 20:08:22 -0230 Subject: Fix Go type 10 spell handling by QAston --HG-- branch : trunk --- src/game/GameObject.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index aa8e6ca9cec..01831f81d50 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -1173,6 +1173,7 @@ void GameObject::Use(Unit* user) // cast this spell later if provided spellId = info->goober.spellId; + spellCaster = NULL; break; } @@ -1482,14 +1483,10 @@ void GameObject::Use(Unit* user) return; } - Spell *spell = new Spell(spellCaster, spellInfo, triggered); - //Spell *spell = new Spell(spellCaster, spellInfo, triggered,GetGUID()); - - // spell target is user of GO - SpellCastTargets targets; - targets.setUnitTarget(user); - - spell->prepare(&targets); + if (spellCaster) + spellCaster->CastSpell(user, spellInfo, triggered); + else + CastSpell(user, spellId); } void GameObject::CastSpell(Unit* target, uint32 spellId) -- cgit v1.2.3