return defaultval;
}
-void Physics_UpdateStats(entity this, float maxspd_mod)
+void Physics_UpdateStats(entity this)
{
+ // update this first, as it's used on all stats (wouldn't want to update them all manually from a mutator hook now, would we?)
+ STAT(MOVEVARS_HIGHSPEED, this) = autocvar_g_movement_highspeed;
+
+ MUTATOR_CALLHOOK(PlayerPhysics_UpdateStats, this);
+ float maxspd_mod = PHYS_HIGHSPEED(this);
+
STAT(MOVEVARS_AIRACCEL_QW, this) = AdjustAirAccelQW(Physics_ClientOption(this, "airaccel_qw", autocvar_sv_airaccel_qw), maxspd_mod);
STAT(MOVEVARS_AIRSTRAFEACCEL_QW, this) = (Physics_ClientOption(this, "airstrafeaccel_qw", autocvar_sv_airstrafeaccel_qw))
? AdjustAirAccelQW(Physics_ClientOption(this, "airstrafeaccel_qw", autocvar_sv_airstrafeaccel_qw), maxspd_mod)
bool Physics_Valid(string thecvar);
- void Physics_UpdateStats(entity this, float maxspd_mod);
+ void Physics_UpdateStats(entity this);
void PM_UpdateButtons(entity this, entity store);
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);
}
bool sys_phys_override(entity this, float dt)
sv_notice_join(this);
// update physics stats (players can spawn before physics runs)
- 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);
IL_EACH(g_initforplayer, it.init_for_player, {
it.init_for_player(it, this);