From: Mario Date: Fri, 24 Apr 2015 10:18:06 +0000 (+1000) Subject: Bring back an old hack to fix spectator speed X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8a00716b4bee3601fdcc0ef519e61c85be750120;p=xonotic%2Fxonotic-data.pk3dir.git Bring back an old hack to fix spectator speed --- diff --git a/qcsrc/common/physics.qc b/qcsrc/common/physics.qc index 442a9939b..8740fc9c5 100644 --- a/qcsrc/common/physics.qc +++ b/qcsrc/common/physics.qc @@ -1635,11 +1635,6 @@ bool IsFlying(entity a) return true; } -#ifdef CSQC -float autocvar_cl_forwardspeed; -float autocvar_cl_sidespeed; -#endif - void PM_Main() { float buttons = PHYS_INPUT_BUTTON_MASK(self); @@ -1651,12 +1646,6 @@ void PM_Main() self.v_angle = PHYS_INPUT_ANGLES(self); self.angles = PHYS_WORLD_ANGLES(self); - if(PHYS_MAXSPEED(self) != autocvar_cl_forwardspeed || PHYS_MAXSPEED(self) != autocvar_cl_sidespeed) - { - cvar_set("cl_forwardspeed", ftos(PHYS_MAXSPEED(self))); - cvar_set("cl_sidespeed", ftos(PHYS_MAXSPEED(self))); - } - self.team = myteam + 1; // is this correct? if (!(PHYS_INPUT_BUTTON_JUMP(self))) // !jump UNSET_JUMP_HELD(self); // canjump = true @@ -1823,6 +1812,17 @@ void PM_Main() } maxspeed_mod = self.spectatorspeed; } + + float spd = max(PHYS_MAXSPEED(self), PHYS_MAXAIRSPEED) * maxspeed_mod; + if(self.speed != spd) + { + self.speed = spd; + string temps = ftos(spd); + stuffcmd(self, strcat("cl_forwardspeed ", temps, "\n")); + stuffcmd(self, strcat("cl_backspeed ", temps, "\n")); + stuffcmd(self, strcat("cl_sidespeed ", temps, "\n")); + stuffcmd(self, strcat("cl_upspeed ", temps, "\n")); + } #endif if(PHYS_DEAD(self))