]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_user.c
got rid of cl_glowinglightning cvar, lightning no longer glows
[xonotic/darkplaces.git] / sv_user.c
index 9bf6c2189efca730953da76f9b5726296965e395..3f306413eb6326bfc7b1e76844b420866803c38a 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -8,7 +8,7 @@ of the License, or (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 See the GNU General Public License for more details.
 
@@ -23,9 +23,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 edict_t        *sv_player;
 
-cvar_t sv_edgefriction = {"edgefriction", "2"};
-cvar_t sv_predict = {"sv_predict", "1"};
-cvar_t sv_deltacompress = {"sv_deltacompress", "1"};
+cvar_t sv_edgefriction = {0, "edgefriction", "2"};
+cvar_t sv_predict = {0, "sv_predict", "1"};
+cvar_t sv_deltacompress = {0, "sv_deltacompress", "1"};
+cvar_t sv_idealpitchscale = {0, "sv_idealpitchscale","0.8"};
+cvar_t sv_maxspeed = {CVAR_NOTIFY, "sv_maxspeed", "320"};
+cvar_t sv_accelerate = {0, "sv_accelerate", "10"};
 
 static vec3_t          forward, right, up;
 
@@ -41,8 +44,6 @@ qboolean      onground;
 
 usercmd_t      cmd;
 
-cvar_t sv_idealpitchscale = {"sv_idealpitchscale","0.8"};
-
 
 /*
 ===============
@@ -76,7 +77,7 @@ void SV_SetIdealPitch (void)
                bottom[1] = top[1];
                bottom[2] = top[2] - 160;
                
-               tr = SV_Move (top, vec3_origin, vec3_origin, bottom, 1, sv_player);
+               tr = SV_Move (top, vec3_origin, vec3_origin, bottom, MOVE_NOMONSTERS, sv_player);
                if (tr.allsolid)
                        return; // looking at a wall, leave ideal the way is was
 
@@ -139,7 +140,7 @@ void SV_UserFriction (void)
        start[2] = origin[2] + sv_player->v.mins[2];
        stop[2] = start[2] - 34;
 
-       trace = SV_Move (start, vec3_origin, vec3_origin, stop, true, sv_player);
+       trace = SV_Move (start, vec3_origin, vec3_origin, stop, MOVE_NOMONSTERS, sv_player);
 
        if (trace.fraction == 1.0)
                friction = sv_friction.value*sv_edgefriction.value;
@@ -165,8 +166,6 @@ void SV_UserFriction (void)
 SV_Accelerate
 ==============
 */
-cvar_t sv_maxspeed = {"sv_maxspeed", "320", false, true};
-cvar_t sv_accelerate = {"sv_accelerate", "10"};
 #if 0
 void SV_Accelerate (vec3_t wishvel)
 {
@@ -466,29 +465,21 @@ void SV_ReadClientMove (usercmd_t *move)
        float   total;
        
 // read ping time
-       host_client->ping_times[host_client->num_pings%NUM_PING_TIMES]
-               = sv.time - MSG_ReadFloat ();
+       host_client->ping_times[host_client->num_pings % NUM_PING_TIMES] = sv.time - MSG_ReadFloat ();
        host_client->num_pings++;
        for (i=0, total = 0;i < NUM_PING_TIMES;i++)
                total += host_client->ping_times[i];
        host_client->ping = total / NUM_PING_TIMES; // can be used for prediction
        host_client->latency = 0;
-       if (sv_predict.value && (svs.maxclients > 1) && (!sv.paused)) // if paused or a local game, don't predict
+       if (sv_predict.integer && (svs.maxclients > 1) && (!sv.paused)) // if paused or a local game, don't predict
                host_client->latency = host_client->ping;
        if ((val = GETEDICTFIELDVALUE(host_client->edict, eval_ping)))
                val->_float = host_client->ping * 1000.0;
 
 // read current angles
-       if (dpprotocol)
-       {
-               for (i=0 ; i<3 ; i++)
-                       angle[i] = MSG_ReadPreciseAngle ();
-       }
-       else
-       {
-               for (i=0 ; i<3 ; i++)
-                       angle[i] = MSG_ReadAngle ();
-       }
+       // dpprotocol
+       for (i=0 ; i<3 ; i++)
+               angle[i] = MSG_ReadPreciseAngle ();
 
        VectorCopy (angle, host_client->edict->v.v_angle);
                
@@ -566,7 +557,7 @@ nextmsg:
                                goto nextmsg;           // end of message
                                
                        default:
-                               Sys_Printf ("SV_ReadClientMessage: unknown command char\n");
+                               Sys_Printf ("SV_ReadClientMessage: unknown command char %i\n", cmd);
                                return false;
                                                        
                        case clc_nop:
@@ -591,8 +582,8 @@ nextmsg:
                                 || Q_strncasecmp(s, "ping", 4) == 0
                                 || Q_strncasecmp(s, "ban", 3) == 0
                                 || Q_strncasecmp(s, "pmodel", 6) == 0
-                                || (nehahra && (Q_strncasecmp(s, "max", 3) == 0 || Q_strncasecmp(s, "monster", 7) == 0 || Q_strncasecmp(s, "scrag", 5) == 0 || Q_strncasecmp(s, "gimme", 5) == 0 || Q_strncasecmp(s, "wraith", 6) == 0))
-                                || (!nehahra && (Q_strncasecmp(s, "god", 3) == 0 || Q_strncasecmp(s, "notarget", 8) == 0 || Q_strncasecmp(s, "fly", 3) == 0 || Q_strncasecmp(s, "give", 4) == 0 || Q_strncasecmp(s, "noclip", 6) == 0)))
+                                || (gamemode == GAME_NEHAHRA && (Q_strncasecmp(s, "max", 3) == 0 || Q_strncasecmp(s, "monster", 7) == 0 || Q_strncasecmp(s, "scrag", 5) == 0 || Q_strncasecmp(s, "gimme", 5) == 0 || Q_strncasecmp(s, "wraith", 6) == 0))
+                                || (gamemode != GAME_NEHAHRA && (Q_strncasecmp(s, "god", 3) == 0 || Q_strncasecmp(s, "notarget", 8) == 0 || Q_strncasecmp(s, "fly", 3) == 0 || Q_strncasecmp(s, "give", 4) == 0 || Q_strncasecmp(s, "noclip", 6) == 0)))
                                {
                                        ret = 1;
                                        Cmd_ExecuteString (s, src_client);