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.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index eab941c8c..5717c8600 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -41,13 +41,18 @@ function script DelAccRegFromEveryPlayer {
query_sql("DELETE FROM `acc_reg_num_db` WHERE `key`='"+getarg(0)+"'");
query_sql("DELETE FROM `acc_reg_str_db` WHERE `key`='"+getarg(0)+"'");
+ if (playerattached())
+ detachrid();
+
// Del variables which SQL can't reach
.@c = getunits(BL_PC, .@players, MAX_CYCLE_PC);
for (.@i = 0; .@i < .@c; .@i++) {
+ attachrid(.@players[.@i]);
if (compare(getarg(0), "$"))
setd(getarg(0), "");
else
setd(getarg(0), 0);
+ detachrid();
}
return;
}