]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_user.c
Add -Wshadow cflag and eliminate its warnings, including with g++
[xonotic/darkplaces.git] / sv_user.c
index 67dbdcc5a943902b8668e0cb5ea664f1bb5045b8..d6cd9aa0df0e8f15ee690ad5409789e46337d1a0 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "sv_demo.h"
 #define DEBUGMOVES 0
 
-static usercmd_t cmd;
+static usercmd_t usercmd;
 extern cvar_t sv_autodemo_perclient;
 
 /*
@@ -443,12 +443,12 @@ static void SV_WaterMove (void)
        AngleVectors(v_angle, forward, right, up);
 
        for (i=0 ; i<3 ; i++)
-               wishvel[i] = forward[i]*cmd.forwardmove + right[i]*cmd.sidemove;
+               wishvel[i] = forward[i]*usercmd.forwardmove + right[i]*usercmd.sidemove;
 
-       if (!cmd.forwardmove && !cmd.sidemove && !cmd.upmove)
+       if (!usercmd.forwardmove && !usercmd.sidemove && !usercmd.upmove)
                wishvel[2] -= 60;               // drift towards bottom
        else
-               wishvel[2] += cmd.upmove;
+               wishvel[2] += usercmd.upmove;
 
        fwishspeed = VectorLength(wishvel);
        if (fwishspeed > sv_maxspeed.value)
@@ -520,8 +520,8 @@ static void SV_AirMove (void)
        wishvel[1] = PRVM_serveredictvector(host_client->edict, angles)[1];
        AngleVectors (wishvel, forward, right, up);
 
-       fmove = cmd.forwardmove;
-       smove = cmd.sidemove;
+       fmove = usercmd.forwardmove;
+       smove = usercmd.sidemove;
 
 // hack to not let you back into teleporter
        if (sv.time < PRVM_serveredictfloat(host_client->edict, teleport_time) && fmove < 0)
@@ -531,7 +531,7 @@ static void SV_AirMove (void)
                wishvel[i] = forward[i]*fmove + right[i]*smove;
 
        if ((int)PRVM_serveredictfloat(host_client->edict, movetype) != MOVETYPE_WALK)
-               wishvel[2] += cmd.upmove;
+               wishvel[2] += usercmd.upmove;
 
        VectorCopy (wishvel, wishdir);
        wishspeed = VectorNormalizeLength(wishdir);
@@ -599,7 +599,7 @@ void SV_ClientThink (void)
        if (PRVM_serveredictfloat(host_client->edict, health) <= 0)
                return;
 
-       cmd = host_client->cmd;
+       usercmd = host_client->cmd;
 
        // angles
        // show 1/3 the pitch angle and all the roll angle