summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/functions/util.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index f89c3a992..aa0ad8249 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -81,6 +81,17 @@ function script DelQuestFromEveryPlayer {
return;
query_sql("DELETE FROM `quest` WHERE `quest_id`="+getarg(0));
+
+ // Del quests which SQL can't reach
+ .@a=playerattached();
+ if (.@a) detachrid();
+ .@c = getunits(BL_PC, .@players, MAX_CYCLE_PC);
+ for (.@i = 0; .@i < .@c; .@i++) {
+ attachrid(.@players[.@i]);
+ setq(getarg(0), 0, 0, 0, 0);
+ detachrid();
+ }
+ if (.@a) attachrid(.@a);
return;
}