From f6154e3c0f894593583203a4117ea8e44675d738 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 17 Jun 2017 13:50:28 +1000 Subject: [PATCH] Add rough support for target_kill --- qcsrc/common/triggers/target/_mod.inc | 1 + qcsrc/common/triggers/target/include.qc | 1 + qcsrc/common/triggers/target/kill.qc | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 qcsrc/common/triggers/target/kill.qc diff --git a/qcsrc/common/triggers/target/_mod.inc b/qcsrc/common/triggers/target/_mod.inc index 71bd8c11e..34c02ba79 100644 --- a/qcsrc/common/triggers/target/_mod.inc +++ b/qcsrc/common/triggers/target/_mod.inc @@ -1,6 +1,7 @@ // generated file; do not modify #include #include +#include #include #include #include diff --git a/qcsrc/common/triggers/target/include.qc b/qcsrc/common/triggers/target/include.qc index c643e4785..4558b71bf 100644 --- a/qcsrc/common/triggers/target/include.qc +++ b/qcsrc/common/triggers/target/include.qc @@ -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 index 000000000..a086bb3c8 --- /dev/null +++ b/qcsrc/common/triggers/target/kill.qc @@ -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 -- 2.39.2