3 void sys_phys_fix(entity this, float dt)
5 WarpZone_PlayerPhysics_FixVAngle(this);
6 Physics_UpdateStats(this, PHYS_HIGHSPEED(this));
9 bool sys_phys_override(entity this)
11 int buttons = PHYS_INPUT_BUTTON_MASK(this);
12 if (PM_check_specialcommand(this, buttons)) return true;
13 if (this.PlayerPhysplug && this.PlayerPhysplug(this)) return true;
17 void sys_phys_monitor(entity this)
19 int buttons = PHYS_INPUT_BUTTON_MASK(this);
20 anticheat_physics(this);
22 if (buttons != this.buttons_old
23 || this.movement != this.movement_old
24 || this.v_angle != this.v_angle_old) this.parm_idlesince = time;
26 PM_check_nickspam(this);
30 void sys_phys_ai(entity this)
32 if (!IS_BOT_CLIENT(this)) return;
33 if (playerdemo_read(this)) return;
37 void sys_phys_pregame_hold(entity this)
39 if (!IS_PLAYER(this)) return;
40 const bool allowed_to_move = (time >= game_starttime);
41 if (!allowed_to_move) {
42 this.velocity = '0 0 0';
43 this.movetype = MOVETYPE_NONE;
44 this.disableclientprediction = 2;
45 } else if (this.disableclientprediction == 2) {
46 if (this.movetype == MOVETYPE_NONE) this.movetype = MOVETYPE_WALK;
47 this.disableclientprediction = 0;
51 void sys_phys_spectator_control(entity this)
53 float maxspeed_mod = autocvar_sv_spectator_speed_multiplier;
54 if (!this.spectatorspeed) this.spectatorspeed = maxspeed_mod;
55 if ((this.impulse >= 1 && this.impulse <= 19)
56 || (this.impulse >= 200 && this.impulse <= 209)
57 || (this.impulse >= 220 && this.impulse <= 229)
59 if (this.lastclassname != STR_PLAYER) {
60 if (this.impulse == 10
63 || (this.impulse >= 200 && this.impulse <= 209)
64 ) this.spectatorspeed = bound(1, this.spectatorspeed + 0.5, 5);
65 else if (this.impulse == 11) this.spectatorspeed = maxspeed_mod;
66 else if (this.impulse == 12
69 || (this.impulse >= 220 && this.impulse <= 229)
70 ) this.spectatorspeed = bound(1, this.spectatorspeed - 0.5, 5);
71 else if (this.impulse >= 1 && this.impulse <= 9) this.spectatorspeed = 1 + 0.5 * (this.impulse - 1);
72 } // otherwise just clear
77 void sys_phys_fixspeed(entity this, float maxspeed_mod)
79 float spd = max(PHYS_MAXSPEED(this), PHYS_MAXAIRSPEED(this)) * maxspeed_mod;
80 if (this.speed != spd) {
82 string temps = ftos(spd);
83 stuffcmd(this, strcat("cl_forwardspeed ", temps, "\n"));
84 stuffcmd(this, strcat("cl_backspeed ", temps, "\n"));
85 stuffcmd(this, strcat("cl_sidespeed ", temps, "\n"));
86 stuffcmd(this, strcat("cl_upspeed ", temps, "\n"));
89 if (this.jumpspeedcap_min != autocvar_sv_jumpspeedcap_min) {
90 this.jumpspeedcap_min = autocvar_sv_jumpspeedcap_min;
91 stuffcmd(this, sprintf("\ncl_jumpspeedcap_min \"%s\"\n", autocvar_sv_jumpspeedcap_min));
93 if (this.jumpspeedcap_max != autocvar_sv_jumpspeedcap_max) {
94 this.jumpspeedcap_max = autocvar_sv_jumpspeedcap_max;
95 stuffcmd(this, sprintf("\ncl_jumpspeedcap_max \"%s\"\n", autocvar_sv_jumpspeedcap_max));