]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/teleporters.qc
Merge branch 'master' into terencehill/tooltips_cleanup
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / teleporters.qc
index a5d89f50bb6035f5f8832869729a94da146fa368..94f2bd26bc99b897a88a45002f27a6a83a7b3f78 100644 (file)
@@ -15,8 +15,8 @@
     #include "../../server/constants.qh"
     #include "../../server/defs.qh"
     #include "../deathtypes.qh"
-    #include "../../server/tturrets/include/turrets_early.qh"
-    #include "../../server/vehicles/all.qh"
+    #include "../turrets/sv_turrets.qh"
+    #include "../vehicles/all.qh"
     #include "../mapinfo.qh"
     #include "../../server/anticheat.qh"
 #endif
@@ -63,7 +63,7 @@ void spawn_tdeath(vector v0, entity e, vector v)
 }
 
 void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags)
-{
+{SELFPARAM();
        entity telefragger;
        vector from;
 
@@ -79,11 +79,11 @@ 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, CH_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTEN_NORM);
+                               sound (player, CH_TRIGGER, SND_TELEPORT, VOL_BASE, ATTEN_NORM);
                        if(tflags & TELEPORT_FLAG_PARTICLES)
                        {
-                               pointparticles(particleeffectnum("teleport"), player.origin, '0 0 0', 1);
-                               pointparticles(particleeffectnum("teleport"), to + v_forward * 32, '0 0 0', 1);
+                               Send_Effect(EFFECT_TELEPORT, player.origin, '0 0 0', 1);
+                               Send_Effect(EFFECT_TELEPORT, to + v_forward * 32, '0 0 0', 1);
                        }
                        self.pushltime = time + 0.2;
                }
@@ -179,7 +179,7 @@ entity Simple_TeleportPlayer(entity teleporter, entity player)
 }
 
 void teleport_findtarget (void)
-{
+{SELFPARAM();
        entity e;
        float n;
 
@@ -190,7 +190,7 @@ void teleport_findtarget (void)
                if(e.movetype == MOVETYPE_NONE)
                        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");
+                       LOG_INFO("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.\n");
        }
 
        if(n == 0)
@@ -224,22 +224,19 @@ entity Teleport_Find(vector mi, vector ma)
 }
 
 void WarpZone_PostTeleportPlayer_Callback(entity pl)
-{
+{SELFPARAM();
        makevectors(pl.angles);
        Reset_ArcBeam(pl, v_forward);
        UpdateCSQCProjectileAfterTeleport(pl);
        {
-               entity oldself = self;
-               self = pl;
-               anticheat_fixangle();
-               self = oldself;
+               WITH(entity, self, pl, anticheat_fixangle());
        }
        // "disown" projectiles after teleport
        if(pl.owner)
        if(pl.owner == pl.realowner)
        {
                if(!(pl.flags & FL_PROJECTILE))
-                       print("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, ".\n");
                pl.owner = world;
        }
        if(IS_PLAYER(pl))