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;
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)
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;