summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/commands/event.txt2
-rw-r--r--npc/functions/util.txt5
2 files changed, 6 insertions, 1 deletions
diff --git a/npc/commands/event.txt b/npc/commands/event.txt
index 0e4ccd621..9a20d02b9 100644
--- a/npc/commands/event.txt
+++ b/npc/commands/event.txt
@@ -308,7 +308,7 @@ function script GlobalEventMenu {
l("Reset Kill Saulc Event (Monthly)");
switch (@menu) {
- case 1: sClear(); set $EVENT$, ""; logmes "Disabled events.", LOGMES_ATCOMMAND;
+ case 1: .@r=playerattached(); sClear(); set $EVENT$, ""; attachrid(.@r); logmes "Disabled events.", LOGMES_ATCOMMAND;
break;
case 2:
set $EVENT$, "Valentine"; $@VALENTINE_LOVELETTER = htnew(); $@VALENTINE_GIFTSTACKS = htnew(); logmes "Enabled VALENTINE DAY event.", LOGMES_ATCOMMAND;
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;
}