]> 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 169cdf0615620cd19a2aee6408b5788f69bc929d..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);
@@ -236,9 +237,15 @@ void teleport_findtarget(entity this)
                ++n;
 #ifdef SVQC
                if(e.move_movetype == MOVETYPE_NONE)
-                       waypoint_spawnforteleporter(this, e.origin, 0);
+               {
+                       entity tracetest_ent = spawn();
+                       setsize(tracetest_ent, PL_MIN_CONST, PL_MAX_CONST);
+                       tracetest_ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
+                       waypoint_spawnforteleporter(this, e.origin, 0, tracetest_ent);
+                       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
        }
 
@@ -295,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))
@@ -304,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;
        }
 }