summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-04-25 00:07:42 -0300
committerJesusaves <cpntb1@ymail.com>2020-04-25 00:07:42 -0300
commit797ba0b43d4b84fec2a90c2b4b056bd203d3bd14 (patch)
tree478c0614dec27f24c2fc84b3da3263c0b4a27935
parented185c63c1662b51d70b0c4e80946b7fb990882d (diff)
downloadserverdata-797ba0b43d4b84fec2a90c2b4b056bd203d3bd14.tar.gz
serverdata-797ba0b43d4b84fec2a90c2b4b056bd203d3bd14.tar.bz2
serverdata-797ba0b43d4b84fec2a90c2b4b056bd203d3bd14.tar.xz
serverdata-797ba0b43d4b84fec2a90c2b4b056bd203d3bd14.zip
This fixes the long standing bug where events did not end properly.
-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;
}