summaryrefslogtreecommitdiff
path: root/npc/functions/util.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/util.txt')
-rw-r--r--npc/functions/util.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 725c1723e..1190714e7 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -18,6 +18,16 @@ function script DelItemFromEveryPlayer {
query_sql("DELETE FROM `guild_storage` WHERE `nameid`="+getarg(0));
query_sql("DELETE FROM `rodex_items` WHERE `nameid`="+getarg(0));
query_sql("DELETE FROM `auction` WHERE `nameid`="+getarg(0));
+ debugmes "Deleting item %d", getarg(0);
+
+ // Del items which SQL can't reach
+ .@c = getunits(BL_PC, .@players, MAX_CYCLE_PC);
+ for (.@i = 0; .@i < .@c; .@i++) {
+ .@am=countitem(getarg(0), .@players[.@i]);
+ if (.@am) debugmes "DELETE %d items from ACC %d", .@am, .@players[.@i];
+ if (.@am)
+ delitem(getarg(0), .@am, .@players[.@i]);
+ }
return;
}