X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fecs%2Fsystems%2Fsv_physics.qc;h=175c57c4844de5206959de1031ad4adff23577fa;hb=19c09c8cfc6a4cb71c07e63bf739b7720ec6b0a0;hp=c20ae8bda2065a58ffd01176ae3ebbe5aa4412f1;hpb=050fb0011ae5fb2b36c7c7f3d560f9453807a8ab;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/ecs/systems/sv_physics.qc b/qcsrc/ecs/systems/sv_physics.qc index c20ae8bda..175c57c48 100644 --- a/qcsrc/ecs/systems/sv_physics.qc +++ b/qcsrc/ecs/systems/sv_physics.qc @@ -4,6 +4,7 @@ void sys_phys_fix(entity this, float dt) { WarpZone_PlayerPhysics_FixVAngle(this); Physics_UpdateStats(this); + PM_ClientMovement_UpdateStatus(this); } bool sys_phys_override(entity this, float dt) @@ -33,7 +34,6 @@ void sys_phys_monitor(entity this, float dt) void sys_phys_ai(entity this) { if (!IS_BOT_CLIENT(this)) { return; } - if (playerdemo_read(this)) { return; } bot_think(this); } @@ -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) @@ -64,16 +64,18 @@ void sys_phys_spectator_control(entity this) || CS(this).impulse == 15 || CS(this).impulse == 18 || (CS(this).impulse >= 200 && CS(this).impulse <= 209) - ) { this.spectatorspeed = bound(1, this.spectatorspeed + 0.5, 5); } else if (CS(this).impulse == 11) { - this.spectatorspeed = maxspeed_mod; + ) { + 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) { + 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; @@ -82,16 +84,6 @@ void sys_phys_spectator_control(entity this) 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); - stuffcmd(this, strcat("cl_forwardspeed ", temps, "\n")); - stuffcmd(this, strcat("cl_backspeed ", temps, "\n")); - stuffcmd(this, strcat("cl_sidespeed ", temps, "\n")); - stuffcmd(this, strcat("cl_upspeed ", temps, "\n")); - } - if (this.jumpspeedcap_min != autocvar_sv_jumpspeedcap_min) { this.jumpspeedcap_min = autocvar_sv_jumpspeedcap_min; stuffcmd(this, sprintf("\ncl_jumpspeedcap_min \"%s\"\n", autocvar_sv_jumpspeedcap_min));