rendered paste bodyIndex: src/game/SpellHandler.cpp
===================================================================
--- src/game/SpellHandler.cpp (revision 5320)
+++ src/game/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->Delete();
+ else
+ obj->SetCharges(charges_cur--);
+ }
+ sLog.outError("Object entry: %u, charges: %u cansel cast spells", obj->GetEntry(), obj->GetCharges());
}
break;