]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/teleport.qc
Add compatibility for target_teleporter as a destination rather than a teleporter
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / teleport.qc
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)