All pastes #925717 Raw Edit

Stuff

public text v1 · immutable
·published 2008-03-03 06:07 UTC
rendered paste body
Index: 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;