]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/delay.qc
Merge branch 'master' into mirceakitsune/playermodel_ubot
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / delay.qc
diff --git a/qcsrc/common/triggers/trigger/delay.qc b/qcsrc/common/triggers/trigger/delay.qc
new file mode 100644 (file)
index 0000000..d6742fe
--- /dev/null
@@ -0,0 +1,22 @@
+#ifdef SVQC
+void delay_use(entity this, entity actor, entity trigger)
+{
+   setthink(this, SUB_UseTargets_self);
+   this.nextthink = this.wait;
+}
+
+void delay_reset(entity this)
+{
+       setthink(this, func_null);
+       this.nextthink = 0;
+}
+
+spawnfunc(trigger_delay)
+{
+    if(!this.wait)
+        this.wait = 1;
+
+    this.use = delay_use;
+    this.reset = delay_reset;
+}
+#endif