]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_user.c
merged two sprite functions into the main callback to slightly clean up the code...
[xonotic/darkplaces.git] / sv_user.c
index 37fe57417d88e4d27b4421e0bfb80f17aa0c1338..66f26938f209347b17b11577bee84548c46aa161 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -25,6 +25,7 @@ cvar_t sv_edgefriction = {0, "edgefriction", "2"};
 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_maxairspeed = {0, "sv_maxairspeed", "30"};
 cvar_t sv_accelerate = {0, "sv_accelerate", "10"};
 
 static usercmd_t cmd;
@@ -176,8 +177,8 @@ void SV_AirAccelerate (vec3_t wishveloc)
        float addspeed, wishspd, accelspeed, currentspeed;
 
        wishspd = VectorNormalizeLength (wishveloc);
-       if (wishspd > 30)
-               wishspd = 30;
+       if (wishspd > sv_maxairspeed.value)
+               wishspd = sv_maxairspeed.value;
        currentspeed = DotProduct (host_client->edict->fields.server->velocity, wishveloc);
        addspeed = wishspd - currentspeed;
        if (addspeed <= 0)
@@ -602,7 +603,6 @@ void SV_ClientThink(void)
 SV_ReadClientMove
 ===================
 */
-extern void SV_Physics_Entity (prvm_edict_t *ent, qboolean runmove);
 void SV_ApplyClientMove (void);
 void SV_ReadClientMove (void)
 {
@@ -692,7 +692,7 @@ void SV_ReadClientMove (void)
                        if (frametime > 0.1)
                                frametime = 0.1;
                        prog->globals.server->frametime = frametime;
-                       SV_Physics_Entity(host_client->edict, true);
+                       SV_Physics_ClientEntity(host_client->edict);
                        prog->globals.server->frametime = oldframetime;
                }
        }
@@ -700,17 +700,22 @@ void SV_ReadClientMove (void)
 
 void SV_ApplyClientMove (void)
 {
+#ifdef NUM_PING_TIMES
        int i;
-       prvm_eval_t *val;
        float total;
+#endif
+       prvm_eval_t *val;
        usercmd_t *move = &host_client->cmd;
 
        // calculate average ping time
+       host_client->ping = move->receivetime - move->time;
+#ifdef NUM_PING_TIMES
        host_client->ping_times[host_client->num_pings % NUM_PING_TIMES] = move->receivetime - move->time;
        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;
+#endif
 
        // set the edict fields
        host_client->edict->fields.server->button0 = move->buttons & 1;