]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add rough support for target_kill
authorMario <mario@smbclan.net>
Sat, 17 Jun 2017 03:50:28 +0000 (13:50 +1000)
committerMario <mario@smbclan.net>
Sat, 17 Jun 2017 03:50:28 +0000 (13:50 +1000)
qcsrc/common/triggers/target/_mod.inc
qcsrc/common/triggers/target/include.qc
qcsrc/common/triggers/target/kill.qc [new file with mode: 0644]

index 71bd8c11e9c4865fb3f27b6142a697dca5b0c8aa..34c02ba79418fbd2ee5f9d6d3d980c13ea0fcb2b 100644 (file)
@@ -1,6 +1,7 @@
 // generated file; do not modify
 #include <common/triggers/target/changelevel.qc>
 #include <common/triggers/target/include.qc>
+#include <common/triggers/target/kill.qc>
 #include <common/triggers/target/levelwarp.qc>
 #include <common/triggers/target/location.qc>
 #include <common/triggers/target/music.qc>
index c643e47857374ea95411805f301221e4383ab229..4558b71bfcdfc519b97588b9a4f75bc114dad50f 100644 (file)
@@ -1,6 +1,7 @@
 #include "include.qh"
 
 #include "changelevel.qc"
+#include "kill.qc"
 #include "levelwarp.qc"
 #include "location.qc"
 #include "music.qc"
diff --git a/qcsrc/common/triggers/target/kill.qc b/qcsrc/common/triggers/target/kill.qc
new file mode 100644 (file)
index 0000000..a086bb3
--- /dev/null
@@ -0,0 +1,25 @@
+#include "location.qh"
+#ifdef SVQC
+
+void target_kill_use(entity this, entity actor, entity trigger)
+{
+       if(actor.takedamage == DAMAGE_NO)
+               return;
+
+       if(!actor.iscreature && !actor.damagedbytriggers)
+               return;
+
+       Damage(actor, this, trigger, 1000, DEATH_HURTTRIGGER.m_id, actor.origin, '0 0 0');
+}
+
+spawnfunc(target_kill)
+{
+    this.classname = "target_kill";
+
+    if (this.message == "")
+               this.message = "was in the wrong place";
+
+    this.use = target_kill_use;
+}
+
+#endif