From: Mario Date: Mon, 10 Jul 2017 12:02:56 +0000 (+1000) Subject: Add compatibility for target_teleporter as a destination rather than a teleporter X-Git-Tag: xonotic-v0.8.5~2421^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=31b3b5a2a866f8181355365eefaef7f2b4dc556b;p=xonotic%2Fxonotic-data.pk3dir.git Add compatibility for target_teleporter as a destination rather than a teleporter --- 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)