From: Mario Date: Sat, 17 Jun 2017 03:50:28 +0000 (+1000) Subject: Add rough support for target_kill X-Git-Tag: xonotic-v0.8.5~2734 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f6154e3c0f894593583203a4117ea8e44675d738;p=xonotic%2Fxonotic-data.pk3dir.git Add rough support for target_kill --- 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