X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Fteleporters.qc;h=e1cd95058dbb7b597f174614c8b203be1674e05d;hp=8e9936b2ea2980586e44844ccb66b27f92801670;hb=d865de7a9a17c5a1d9286aec40f68c3530697660;hpb=81062a39c99785039ceee2dcd187fed9352a08c5 diff --git a/qcsrc/common/triggers/teleporters.qc b/qcsrc/common/triggers/teleporters.qc index 8e9936b2ea..e1cd95058d 100644 --- a/qcsrc/common/triggers/teleporters.qc +++ b/qcsrc/common/triggers/teleporters.qc @@ -228,9 +228,10 @@ entity Simple_TeleportPlayer(entity teleporter, entity player) void teleport_findtarget(entity this) { + bool istrigger = (this.solid == SOLID_TRIGGER); + int n = 0; - entity e; - for(e = NULL; (e = find(e, targetname, this.target)); ) + for(entity e = NULL; (e = find(e, targetname, this.target)); ) { ++n; #ifdef SVQC @@ -250,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 { @@ -259,9 +260,11 @@ void teleport_findtarget(entity this) } // now enable touch - settouch(this, Teleport_Touch); + if(istrigger) + settouch(this, Teleport_Touch); #ifdef SVQC - trigger_teleport_link(this); + if(istrigger) + trigger_teleport_link(this); #endif }