X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fecs%2Fsystems%2Fsv_physics.qc;h=5ae47c394da75d90665680af45cb8fccbfa9f71a;hp=6731bdf9433b7e228481237974e79a020334ddfa;hb=224f6d8084e73e0e643cb2d9d58c466defa9d134;hpb=5e4918a93971eb7ce36a44f5286163be598e0663 diff --git a/qcsrc/ecs/systems/sv_physics.qc b/qcsrc/ecs/systems/sv_physics.qc index 6731bdf94..5ae47c394 100644 --- a/qcsrc/ecs/systems/sv_physics.qc +++ b/qcsrc/ecs/systems/sv_physics.qc @@ -54,7 +54,7 @@ void sys_phys_pregame_hold(entity this) void sys_phys_spectator_control(entity this) { float maxspeed_mod = autocvar_sv_spectator_speed_multiplier; - if (!this.spectatorspeed) { this.spectatorspeed = maxspeed_mod; } + if (!STAT(SPECTATORSPEED, this)) { STAT(SPECTATORSPEED, this) = maxspeed_mod; } if ((CS(this).impulse >= 1 && CS(this).impulse <= 19) || (CS(this).impulse >= 200 && CS(this).impulse <= 209) || (CS(this).impulse >= 220 && CS(this).impulse <= 229) @@ -65,17 +65,17 @@ void sys_phys_spectator_control(entity this) || CS(this).impulse == 18 || (CS(this).impulse >= 200 && CS(this).impulse <= 209) ) { - this.spectatorspeed = bound(1, this.spectatorspeed + 0.5, 5); + STAT(SPECTATORSPEED, this) = bound(autocvar_sv_spectator_speed_multiplier_min, STAT(SPECTATORSPEED, this) + 0.5, autocvar_sv_spectator_speed_multiplier_max); } else if (CS(this).impulse == 11) { - this.spectatorspeed = maxspeed_mod; + STAT(SPECTATORSPEED, this) = maxspeed_mod; } else if (CS(this).impulse == 12 || CS(this).impulse == 16 || CS(this).impulse == 19 || (CS(this).impulse >= 220 && CS(this).impulse <= 229) ) { - this.spectatorspeed = bound(1, this.spectatorspeed - 0.5, 5); + STAT(SPECTATORSPEED, this) = bound(autocvar_sv_spectator_speed_multiplier_min, STAT(SPECTATORSPEED, this) - 0.5, autocvar_sv_spectator_speed_multiplier_max); } else if (CS(this).impulse >= 1 && CS(this).impulse <= 9) { - this.spectatorspeed = 1 + 0.5 * (CS(this).impulse - 1); + STAT(SPECTATORSPEED, this) = 1 + 0.5 * (CS(this).impulse - 1); } } // otherwise just clear CS(this).impulse = 0; @@ -86,7 +86,7 @@ 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; + this.speed = spd; // TODO: send this as a stat and set the below cvars on the client? string temps = ftos(spd); stuffcmd(this, strcat("cl_forwardspeed ", temps, "\n")); stuffcmd(this, strcat("cl_backspeed ", temps, "\n"));