void sys_phys_fix(entity this, float dt)
{
WarpZone_PlayerPhysics_FixVAngle(this);
- STAT(MOVEVARS_HIGHSPEED, this) = autocvar_g_movement_highspeed;
- MUTATOR_CALLHOOK(PlayerPhysics_UpdateStats, this); // do it BEFORE the function so we can modify highspeed!
- Physics_UpdateStats(this, PHYS_HIGHSPEED(this));
+ Physics_UpdateStats(this);
+ PM_ClientMovement_UpdateStatus(this);
}
bool sys_phys_override(entity this, float dt)
int buttons = PHYS_INPUT_BUTTON_MASK(this);
anticheat_physics(this);
if (sv_maxidle > 0) {
- if (buttons != this.buttons_old
- || this.movement != this.movement_old
- || this.v_angle != this.v_angle_old) { CS(this).parm_idlesince = time; }
+ if (buttons != CS(this).buttons_old
+ || CS(this).movement != CS(this).movement_old
+ || this.v_angle != CS(this).v_angle_old) { CS(this).parm_idlesince = time; }
}
PM_check_nickspam(this);
PM_check_punch(this, dt);
void sys_phys_ai(entity this)
{
if (!IS_BOT_CLIENT(this)) { return; }
- if (playerdemo_read(this)) { return; }
bot_think(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)
|| 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;
{
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"));