From 31b3b5a2a866f8181355365eefaef7f2b4dc556b Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 10 Jul 2017 22:02:56 +1000 Subject: [PATCH] Add compatibility for target_teleporter as a destination rather than a teleporter --- qcsrc/common/triggers/teleporters.qc | 2 +- qcsrc/common/triggers/trigger/teleport.qc | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/qcsrc/common/triggers/teleporters.qc b/qcsrc/common/triggers/teleporters.qc index 7e30973f5..169cdf061 100644 --- a/qcsrc/common/triggers/teleporters.qc +++ b/qcsrc/common/triggers/teleporters.qc @@ -251,7 +251,7 @@ void teleport_findtarget(entity this) else if(n == 1) { // exactly one dest - bots love that - this.enemy = find(e, targetname, this.target); + this.enemy = find(NULL, targetname, this.target); } else { diff --git a/qcsrc/common/triggers/trigger/teleport.qc b/qcsrc/common/triggers/trigger/teleport.qc index bc7c62f30..519d914e0 100644 --- a/qcsrc/common/triggers/trigger/teleport.qc +++ b/qcsrc/common/triggers/trigger/teleport.qc @@ -138,6 +138,13 @@ spawnfunc(trigger_teleport) spawnfunc(target_teleporter) { + if(this.target == "") + { + // actually a destination! + spawnfunc_info_teleport_destination(this); + return; + } + this.active = ACTIVE_ACTIVE; this.use = target_teleport_use; @@ -146,12 +153,6 @@ spawnfunc(target_teleporter) FOREACH_WORD(this.noise, true, precache_sound(it)); InitializeEntity(this, teleport_findtarget, INITPRIO_FINDTARGET); - - if (this.target == "") - { - objerror (this, "Teleporter with no target"); - return; - } } #elif defined(CSQC) NET_HANDLE(ENT_CLIENT_TRIGGER_TELEPORT, bool isnew) -- 2.39.2