]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/ecs/systems/cl_physics.qc
Make ladders use the same iterative logic as conveyors, fixes some maps with super...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / ecs / systems / cl_physics.qc
index 206c80d96526f4001200bd8b6d0a56d9a05e3fd6..d4718514d232770721dc8d215b87e35dd51b8f0a 100644 (file)
@@ -3,23 +3,20 @@
 void sys_phys_fix(entity this, float dt)
 {
        this.team = myteam + 1; // is this correct?
-       PHYS_WATERJUMP_TIME(this) -= dt;
-       this.oldmovement = this.movement;
        this.movement = PHYS_INPUT_MOVEVALUES(this);
        this.items = STAT(ITEMS, this);
-       this.spectatorspeed = STAT(SPECTATORSPEED, this);
        if (!(PHYS_INPUT_BUTTON_JUMP(this))) // !jump
                UNSET_JUMP_HELD(this);           // canjump = true
        PM_ClientMovement_UpdateStatus(this);
 }
 
-bool sys_phys_override(entity this)
+bool sys_phys_override(entity this, float dt)
 {
        // no vehicle prediction
        return hud != HUD_NORMAL;
 }
 
-void sys_phys_monitor(entity this) {}
+void sys_phys_monitor(entity this, float dt) {}
 
 void sys_phys_ai(entity this) {}
 
@@ -27,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 = max(PHYS_MAXSPEED(this), PHYS_MAXAIRSPEED(this)) * maxspeed_mod;
+       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);
+       }
+}