]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/teleporters.qc
Remove .move_* fields and MOVETYPE_PUSH logic (doesn't work)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / teleporters.qc
index 20f618aa2477392872f2c2c12cdd8e7a256591cb..be8666eb8bd1a695dc1a42ee9db394a5d9dde240 100644 (file)
@@ -124,22 +124,20 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
        UpdateCSQCProjectileAfterTeleport(player);
        UpdateItemAfterTeleport(player);
 #elif defined(CSQC)
-       from = player.move_origin;
-       player.move_origin = to;
-       player.move_angles = to_angles;
-       player.move_velocity = to_velocity;
-       player.move_flags &= ~FL_ONGROUND;
+       from = player.origin;
+       setorigin(player, to);
+       player.angles = to_angles;
+       player.velocity = to_velocity;
+       player.flags &= ~FL_ONGROUND;
        player.iflags |= IFLAG_TELEPORTED | IFLAG_V_ANGLE | IFLAG_ANGLES;
        player.csqcmodel_teleported = 1;
        player.v_angle = to_angles;
 
-       if(player.isplayermodel) // not for anything but the main player
+       if(player == csqcplayer) // not for anything but the main player
        {
-               setproperty(VF_ANGLES, player.move_angles);
-               setproperty(VF_CL_VIEWANGLES, player.move_angles);
+               setproperty(VF_ANGLES, player.angles);
+               setproperty(VF_CL_VIEWANGLES, player.angles);
        }
-
-       makevectors(player.move_angles);
 #endif
 
 #ifdef SVQC
@@ -213,35 +211,17 @@ entity Simple_TeleportPlayer(entity teleporter, entity player)
 
        makevectors(e.mangle);
 
-#ifdef SVQC
        if(e.speed)
                if(vdist(player.velocity, >, e.speed))
                        player.velocity = normalize(player.velocity) * max(0, e.speed);
-#elif defined(CSQC)
-       if(e.speed)
-               if(vdist(player.move_velocity, >, e.speed))
-                       player.move_velocity = normalize(player.move_velocity) * max(0, e.speed);
-#endif
 
-#ifdef SVQC
        if(STAT(TELEPORT_MAXSPEED, player))
                if(vdist(player.velocity, >, STAT(TELEPORT_MAXSPEED, player)))
                        player.velocity = normalize(player.velocity) * max(0, STAT(TELEPORT_MAXSPEED, player));
-#elif defined(CSQC)
-       if(STAT(TELEPORT_MAXSPEED, player))
-               if(vdist(player.move_velocity, >, STAT(TELEPORT_MAXSPEED, player)))
-                       player.move_velocity = normalize(player.move_velocity) * max(0, STAT(TELEPORT_MAXSPEED, player));
-#endif
 
-#ifdef SVQC
        locout = e.origin + '0 0 1' * (1 - player.mins.z - 24);
 
        TeleportPlayer(teleporter, player, locout, e.mangle, v_forward * vlen(player.velocity), '0 0 0', '0 0 0', TELEPORT_FLAGS_TELEPORTER);
-#elif defined(CSQC)
-       locout = e.origin + '0 0 1' * (1 - player.mins.z - 24);
-
-       TeleportPlayer(teleporter, player, locout, e.mangle, v_forward * vlen(player.move_velocity), '0 0 0', '0 0 0', TELEPORT_FLAGS_TELEPORTER);
-#endif
 
        return e;
 }
@@ -310,7 +290,7 @@ void WarpZone_PostTeleportPlayer_Callback(entity pl)
        #ifdef SVQC
                if(!(pl.flags & FL_PROJECTILE))
        #elif defined(CSQC)
-               if(!(pl.move_flags & BIT(15))) // FL_PROJECTILE
+               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");
                pl.owner = NULL;