]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/teleporters.qc
Don't even try to translate keys if game isn't translated
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / teleporters.qc
index 13a0c41d3fdbb83cda4363935a1e341f8f8b5dd5..25626e01b157eeb31a881bd0209f785af2a32f5a 100644 (file)
@@ -51,11 +51,11 @@ void tdeath(entity player, entity teleporter, entity telefragger, vector telefra
                                if(IS_PLAYER(head))
                                        if(head.health >= 1)
                                                ++tdeath_hit;
-                               Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG.m_id, head.origin, '0 0 0');
+                               Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG.m_id, DMG_NOWEP, head.origin, '0 0 0');
                        }
                }
                else // dead bodies and monsters gib themselves instead of telefragging
-                       Damage (telefragger, teleporter, telefragger, 10000, DEATH_TELEFRAG.m_id, telefragger.origin, '0 0 0');
+                       Damage (telefragger, teleporter, telefragger, 10000, DEATH_TELEFRAG.m_id, DMG_NOWEP, telefragger.origin, '0 0 0');
        }
 }
 
@@ -165,6 +165,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
                }
 
                player.lastteleporttime = time;
+               player.lastteleport_origin = from;
        }
 #endif
 }
@@ -206,7 +207,7 @@ entity Simple_TeleportPlayer(entity teleporter, entity player)
 #ifdef SVQC
        if(!e) { sprint(player, "Teleport destination vanished. Sorry... please complain to the mapper.\n"); }
 #elif defined(CSQC)
-       if(!e) { LOG_INFO("Teleport destination could not be found from CSQC.\n"); }
+       if(!e) { LOG_INFO("Teleport destination could not be found from CSQC."); }
 #endif
 
        makevectors(e.mangle);
@@ -228,9 +229,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
@@ -243,7 +245,7 @@ void teleport_findtarget(entity this)
                        delete(tracetest_ent);
                }
                if(e.classname != "info_teleport_destination")
-                       LOG_INFO("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.\n");
+                       LOG_INFO("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.");
 #endif
        }
 
@@ -256,7 +258,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
        {
@@ -265,9 +267,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
 }
 
@@ -298,7 +302,7 @@ void WarpZone_PostTeleportPlayer_Callback(entity pl)
        #elif defined(CSQC)
                if(!(pl.flags & BIT(15))) // FL_PROJECTILE
        #endif
-                       LOG_INFO("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".\n");
+                       LOG_INFO("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".");
                pl.owner = NULL;
        }
        if(IS_PLAYER(pl))
@@ -307,7 +311,5 @@ void WarpZone_PostTeleportPlayer_Callback(entity pl)
        #ifdef SVQC
                pl.oldvelocity = pl.velocity;
        #endif
-               // reset teleport time tracking too (or multijump can cause insane speeds)
-               pl.lastteleporttime = time;
        }
 }