rendered paste bodyIndex: SpellHandler.cpp
===================================================================
--- SpellHandler.cpp (revision 5320)
+++ SpellHandler.cpp (working copy)
@@ -289,11 +289,18 @@
info = obj->GetGOInfo();
if(info)
{
+ sLog.outError("Object entry: %u, charges: %u cast spells, check it", obj->GetEntry(), obj->GetCharges());
spellId = info->data0;
if (spellId == 0)
spellId = info->data3;
-
- //guid=_player->GetGUID();
+ if(uint32 charges_cur = obj->GetCharges())
+ {
+ if(--charges_cur)
+ obj->SetCharges(charges_cur);
+ else
+ obj->Delete();
+ }
+ sLog.outError("Object entry: %u, charges: %u cansel cast spells", obj->GetEntry(), obj->GetCharges());
}
break;