]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add compatibility for target_teleporter as a destination rather than a teleporter
authorMario <mario@smbclan.net>
Mon, 10 Jul 2017 12:02:56 +0000 (22:02 +1000)
committerMario <mario@smbclan.net>
Mon, 10 Jul 2017 12:02:56 +0000 (22:02 +1000)
qcsrc/common/triggers/teleporters.qc
qcsrc/common/triggers/trigger/teleport.qc

index 7e30973f5ac826ddad9e20ff055549da5df5872f..169cdf0615620cd19a2aee6408b5788f69bc929d 100644 (file)
@@ -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
        {
index bc7c62f30e7a2a6153a18f9631a990a076437466..519d914e0ff8c43d03a7e902157ce74a2629d4b1 100644 (file)
@@ -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)