Merge branch 'master' into Mario/speed_var
[xonotic/xonotic-data.pk3dir.git] / qcsrc / ecs / systems / cl_physics.qc
index 624e0a9126e8a497272cf0ad2a9c98ec6b26b2eb..4d38c574d9cdac5345bdf9782989aed40b694f7d 100644 (file)
@@ -24,4 +24,15 @@ void sys_phys_pregame_hold(entity this) {}
 
 void sys_phys_spectator_control(entity this) {}
 
-void sys_phys_fixspeed(entity this, float maxspeed_mod) {}
+void sys_phys_fixspeed(entity this, float maxspeed_mod)
+{
+       float spd = STAT(MOVEVARS_SPEED, this);
+       if (this.speed != spd) {
+               this.speed = spd;
+               string temps = ftos(spd);
+               cvar_set("cl_forwardspeed", temps);
+               cvar_set("cl_backspeed", temps);
+               cvar_set("cl_sidespeed", temps);
+               cvar_set("cl_upspeed", temps);
+       }
+}