X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Ft_teleporters.qc;h=0adbd5196af1731fecf51774167e77816d161c1b;hb=b5a593d8425521092f05949c4143d86a25d49f4c;hp=fbb803294269e5e07bf1a36a0d2675ea28645f4b;hpb=3cd77e9863d3c7622c1d31d1b5c3686593ff09c8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/t_teleporters.qc b/qcsrc/server/t_teleporters.qc index fbb803294..0adbd5196 100644 --- a/qcsrc/server/t_teleporters.qc +++ b/qcsrc/server/t_teleporters.qc @@ -90,7 +90,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle if(self.pushltime < time) // only show one teleport effect per teleporter per 0.2 seconds, for better fps { if(tflags & TELEPORT_FLAG_SOUND) - sound (player, CHAN_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTN_NORM); + sound (player, CH_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTN_NORM); if(tflags & TELEPORT_FLAG_PARTICLES) { pointparticles(particleeffectnum("teleport"), player.origin, '0 0 0', 1); @@ -148,9 +148,14 @@ void Teleport_Touch (void) if (self.active != ACTIVE_ACTIVE) return; - if (other.health < 1) + if not(other.iscreature) return; - if not(other.flags & FL_CLIENT) // FIXME: Make missiles firable through the teleport too + + // for gameplay: vehicles can't teleport + if (other.vehicle_flags & VHF_ISVEHICLE) + return; + + if (other.deadflag != DEAD_NO) return; if(self.team) @@ -246,18 +251,15 @@ void teleport_findtarget (void) entity e; float n; - RandomSelection_Init(); n = 0; for(e = world; (e = find(e, targetname, self.target)); ) { ++n; if(e.movetype == MOVETYPE_NONE) - RandomSelection_Add(e, 0, string_null, 1, 1); + waypoint_spawnforteleporter(self, e.origin, 0); if(e.classname != "info_teleport_destination") print("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.\n"); } - if(RandomSelection_chosen_ent) - waypoint_spawnforteleporter(self, RandomSelection_chosen_ent.origin, 0); if(n == 0) { @@ -269,7 +271,6 @@ void teleport_findtarget (void) { // exactly one dest - bots love that self.enemy = find(e, targetname, self.target); - self.dest = self.enemy.origin; } else { @@ -304,6 +305,9 @@ void spawnfunc_trigger_teleport (void) void WarpZone_PostTeleportPlayer_Callback(entity pl) { UpdateCSQCProjectileAfterTeleport(pl); + // "disown" projectiles after teleport + if(pl.owner == pl.realowner) + pl.owner = world; if(pl.classname == "player") { // reset tracking of oldvelocity for impact damage (sudden velocity changes)