X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fecs%2Fsystems%2Fcl_physics.qc;h=d4718514d232770721dc8d215b87e35dd51b8f0a;hb=deb4c0dce1468665f6328aea364ab570b93490f8;hp=f74e9c2d5526c895fd8b28c1bdd9bb7a884faef0;hpb=34e7f534e2015466228eb3a78c9857741b736dca;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/ecs/systems/cl_physics.qc b/qcsrc/ecs/systems/cl_physics.qc index f74e9c2d5..d4718514d 100644 --- a/qcsrc/ecs/systems/cl_physics.qc +++ b/qcsrc/ecs/systems/cl_physics.qc @@ -3,10 +3,8 @@ void sys_phys_fix(entity this, float dt) { this.team = myteam + 1; // is this correct? - PHYS_WATERJUMP_TIME(this) -= dt; 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); @@ -26,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); + } +}