Code:
Index: ArcEmu/GUAEngine/engine/GoFunctions.cpp
===================================================================
--- ArcEmu/GUAEngine/engine/GoFunctions.cpp (revision 46)
+++ ArcEmu/GUAEngine/engine/GoFunctions.cpp (working copy)
@@ -512,8 +512,9 @@
uint32 sp = luaL_checkint(L,1);
if( !ptr || !sp|| sp == 0) return 0;
- Spell * spp = new Spell();
- spp->Init(ptr,dbcSpell.LookupEntry(sp),true, NULL);
+ Spell * spp = new Spell(ptr,dbcSpell.LookupEntry(sp),true, NULL);
+ if (!spp)
+ return 0;
SpellCastTargets tar(ptr->GetGUID());
spp->prepare(&tar);
return 0;
@@ -524,8 +525,9 @@
uint32 sp = luaL_checkint(L,1);
if( !ptr || !sp|| sp == 0) return 0;
- Spell * nspell = new Spell();
- nspell->Init(ptr,dbcSpell.LookupEntry(sp),false,NULL);
+ Spell * nspell = new Spell(ptr,dbcSpell.LookupEntry(sp),false,NULL);
+ if (!nspell)
+ return 0;
SpellCastTargets tar(ptr->GetGUID());
nspell->prepare(&tar);
return 0;
@@ -537,8 +539,9 @@
Unit * target = Lunar<Unit>::check(L,2);
if( !ptr || !sp || sp == 0) return 0;
- Spell * nspell = new Spell();
- nspell->Init(ptr,dbcSpell.LookupEntry(sp),true,NULL);
+ Spell * nspell = new Spell(ptr,dbcSpell.LookupEntry(sp),true,NULL);
+ if (nspell)
+ return 0;
SpellCastTargets tar(target->GetGUID());
nspell->prepare(&tar);
return 0;
@@ -549,8 +552,9 @@
uint32 sp = luaL_checkint(L,1);
Unit * target = Lunar<Unit>::check(L,2);
if( !ptr || !sp || sp == 0) return 0;
- Spell * nspell = new Spell();
- nspell->Init(ptr,dbcSpell.LookupEntry(sp),false,NULL);
+ Spell * nspell = new Spell(ptr,dbcSpell.LookupEntry(sp),false,NULL);
+ if (!nspell)
+ return 0;
SpellCastTargets tar(target->GetGUID());
nspell->prepare(&tar);
return 0;
Index: ArcEmu/GUAEngine/engine/GuaFunctions.cpp
===================================================================
--- ArcEmu/GUAEngine/engine/GuaFunctions.cpp (revision 46)
+++ ArcEmu/GUAEngine/engine/GuaFunctions.cpp (working copy)
@@ -26,8 +26,9 @@
}
else
{
- Spell * sp = SpellPool.PooledNew();
- sp->Init(plr, info, true, 0);
+ Spell * sp = new Spell(plr, info, true, 0);
+ if (!sp)
+ return 1;
SpellCastTargets targets(plr->GetGUID());
sp->prepare(&targets);
}