X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Fteleporters.qc;h=25626e01b157eeb31a881bd0209f785af2a32f5a;hp=451afa95b4a3d4d0500064d55e219ca94cc822a5;hb=05d2779856eda44ed6c8779ab55380fa006cfcb4;hpb=e2513379a97ff9ab28cdb4f5959912cb2a64985f diff --git a/qcsrc/common/triggers/teleporters.qc b/qcsrc/common/triggers/teleporters.qc index 451afa95b..25626e01b 100644 --- a/qcsrc/common/triggers/teleporters.qc +++ b/qcsrc/common/triggers/teleporters.qc @@ -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,16 +229,23 @@ 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 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 } @@ -250,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 { @@ -259,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 } @@ -292,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)) @@ -301,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; } }