summaryrefslogtreecommitdiff
path: root/npc/functions/main.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/main.txt')
-rw-r--r--npc/functions/main.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/npc/functions/main.txt b/npc/functions/main.txt
index f2dad770..420f2b79 100644
--- a/npc/functions/main.txt
+++ b/npc/functions/main.txt
@@ -172,3 +172,16 @@ function script askyesno {
return select (menuaction(l("Yes")),
menuaction(l("No")));
}
+
+// Argument:
+// 0 Quest variable
+// 1 Current value
+// 2 Next value
+function script compareandsetq {
+ if (getq (getarg(0)) == getarg(1))
+ {
+ setq getarg(0), getarg(2);
+ return true;
+ }
+ return false;
+}