]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/ecs/systems/sv_physics.qc
Forward impulses, movement and buttons to ClientState, also port impulse to ClientState
[xonotic/xonotic-data.pk3dir.git] / qcsrc / ecs / systems / sv_physics.qc
index 20cd53144f884ffff258aef9d9c7ff37b15f6045..fc065b2ad7f62de8d9bff42d3177378531adfeb9 100644 (file)
@@ -57,28 +57,28 @@ void sys_phys_spectator_control(entity this)
 {
        float maxspeed_mod = autocvar_sv_spectator_speed_multiplier;
        if (!this.spectatorspeed) { this.spectatorspeed = maxspeed_mod; }
-       if ((this.impulse >= 1 && this.impulse <= 19)
-           || (this.impulse >= 200 && this.impulse <= 209)
-           || (this.impulse >= 220 && this.impulse <= 229)
+       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)
           ) {
                if (this.lastclassname != STR_PLAYER) {
-                       if (this.impulse == 10
-                           || this.impulse == 15
-                           || this.impulse == 18
-                           || (this.impulse >= 200 && this.impulse <= 209)
-                          ) { this.spectatorspeed = bound(1, this.spectatorspeed + 0.5, 5); } else if (this.impulse == 11) {
+                       if (CS(this).impulse == 10
+                           || 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;
-                       } else if (this.impulse == 12
-                           || this.impulse == 16
-                           || this.impulse == 19
-                           || (this.impulse >= 220 && this.impulse <= 229)
+                       } 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);
-                       } else if (this.impulse >= 1 && this.impulse <= 9) {
-                               this.spectatorspeed = 1 + 0.5 * (this.impulse - 1);
+                       } else if (CS(this).impulse >= 1 && CS(this).impulse <= 9) {
+                               this.spectatorspeed = 1 + 0.5 * (CS(this).impulse - 1);
                        }
                }  // otherwise just clear
-               this.impulse = 0;
+               CS(this).impulse = 0;
        }
 }