From 0019a7a892b7f986e74a0d4e202a96d208494f3e Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 7 Aug 2016 14:53:25 +1000 Subject: [PATCH] Clear out PHYS_INPUT_TIMELENGTH from most of the physics code --- qcsrc/common/mutators/events.qh | 1 + qcsrc/common/physics/player.qc | 34 +++++++-------- qcsrc/common/physics/player.qh | 2 +- qcsrc/common/turrets/cl_turrets.qc | 11 +++-- qcsrc/common/vehicles/sv_vehicles.qc | 2 +- qcsrc/common/vehicles/vehicle.qh | 2 +- qcsrc/common/vehicles/vehicle/bumblebee.qc | 42 +++++++++---------- qcsrc/common/vehicles/vehicle/racer.qc | 28 ++++++------- qcsrc/common/vehicles/vehicle/raptor.qc | 26 ++++++------ qcsrc/common/vehicles/vehicle/spiderbot.qc | 18 ++++---- qcsrc/ecs/systems/cl_physics.qc | 4 +- qcsrc/ecs/systems/physics.qc | 18 ++++---- qcsrc/ecs/systems/physics.qh | 4 +- qcsrc/ecs/systems/sv_physics.qc | 8 ++-- qcsrc/server/mutators/mutator/gamemode_cts.qc | 3 +- .../server/mutators/mutator/gamemode_race.qc | 3 +- 16 files changed, 107 insertions(+), 99 deletions(-) diff --git a/qcsrc/common/mutators/events.qh b/qcsrc/common/mutators/events.qh index ef1a9663d..0dbc9ea21 100644 --- a/qcsrc/common/mutators/events.qh +++ b/qcsrc/common/mutators/events.qh @@ -75,6 +75,7 @@ MUTATOR_HOOKABLE(WP_Format, EV_WP_Format); */ #define EV_PlayerPhysics(i, o) \ /** player */ i(entity, MUTATOR_ARGV_0_entity) \ + /** ticrate*/ i(float, MUTATOR_ARGV_1_float) \ /**/ MUTATOR_HOOKABLE(PlayerPhysics, EV_PlayerPhysics); diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index 74a44252f..9341f1b2b 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -159,7 +159,7 @@ void PM_ClientMovement_UpdateStatus(entity this) #endif } -void CPM_PM_Aircontrol(entity this, vector wishdir, float wishspeed) +void CPM_PM_Aircontrol(entity this, float dt, vector wishdir, float wishspeed) { float k = 32 * (2 * IsMoveInDirection(this.movement, 0) - 1); if (k <= 0) @@ -176,7 +176,7 @@ void CPM_PM_Aircontrol(entity this, vector wishdir, float wishspeed) if (dot > 0) // we can't change direction while slowing down { - k *= pow(dot, PHYS_AIRCONTROL_POWER(this)) * PHYS_INPUT_TIMELENGTH; + k *= pow(dot, PHYS_AIRCONTROL_POWER(this)) * dt; xyspeed = max(0, xyspeed - PHYS_AIRCONTROL_PENALTY(this) * sqrt(max(0, 1 - dot*dot)) * k/32); k *= PHYS_AIRCONTROL(this); this.velocity = normalize(this.velocity * xyspeed + wishdir * k); @@ -196,7 +196,7 @@ float AdjustAirAccelQW(float accelqw, float factor) // sv_airaccel_sideways_friction 0 // prvm_globalset server speedclamp_mode 1 // (or 2) -void PM_Accelerate(entity this, vector wishdir, float wishspeed, float wishspeed0, float accel, float accelqw, float stretchfactor, float sidefric, float speedlimit) +void PM_Accelerate(entity this, float dt, vector wishdir, float wishspeed, float wishspeed0, float accel, float accelqw, float stretchfactor, float sidefric, float speedlimit) { float speedclamp = stretchfactor > 0 ? stretchfactor : accelqw < 0 ? 1 // full clamping, no stretch @@ -212,7 +212,7 @@ void PM_Accelerate(entity this, vector wishdir, float wishspeed, float wishspeed vector vel_xy = vec2(this.velocity); vector vel_perpend = vel_xy - vel_straight * wishdir; - float step = accel * PHYS_INPUT_TIMELENGTH * wishspeed0; + float step = accel * dt * wishspeed0; float vel_xy_current = vlen(vel_xy); if (speedlimit) @@ -225,7 +225,7 @@ void PM_Accelerate(entity this, vector wishdir, float wishspeed, float wishspeed if (sidefric < 0 && (vel_perpend*vel_perpend)) // negative: only apply so much sideways friction to stay below the speed you could get by "braking" { - float f = max(0, 1 + PHYS_INPUT_TIMELENGTH * wishspeed * sidefric); + float f = max(0, 1 + dt * wishspeed * sidefric); float themin = (vel_xy_backward * vel_xy_backward - vel_straight * vel_straight) / (vel_perpend * vel_perpend); // assume: themin > 1 // vel_xy_backward*vel_xy_backward - vel_straight*vel_straight > vel_perpend*vel_perpend @@ -241,7 +241,7 @@ void PM_Accelerate(entity this, vector wishdir, float wishspeed, float wishspeed } } else - vel_perpend *= max(0, 1 - PHYS_INPUT_TIMELENGTH * wishspeed * sidefric); + vel_perpend *= max(0, 1 - dt * wishspeed * sidefric); vel_xy = vel_straight * wishdir + vel_perpend; @@ -260,7 +260,7 @@ void PM_Accelerate(entity this, vector wishdir, float wishspeed, float wishspeed this.velocity = vel_xy + vel_z * '0 0 1'; } -void PM_AirAccelerate(entity this, vector wishdir, float wishspeed) +void PM_AirAccelerate(entity this, float dt, vector wishdir, float wishspeed) { if (wishspeed == 0) return; @@ -270,18 +270,18 @@ void PM_AirAccelerate(entity this, vector wishdir, float wishspeed) float curspeed = vlen(curvel); if (wishspeed > curspeed * 1.01) - wishspeed = min(wishspeed, curspeed + PHYS_WARSOWBUNNY_AIRFORWARDACCEL(this) * PHYS_MAXSPEED(this) * PHYS_INPUT_TIMELENGTH); + wishspeed = min(wishspeed, curspeed + PHYS_WARSOWBUNNY_AIRFORWARDACCEL(this) * PHYS_MAXSPEED(this) * dt); else { float f = max(0, (PHYS_WARSOWBUNNY_TOPSPEED(this) - curspeed) / (PHYS_WARSOWBUNNY_TOPSPEED(this) - PHYS_MAXSPEED(this))); - wishspeed = max(curspeed, PHYS_MAXSPEED(this)) + PHYS_WARSOWBUNNY_ACCEL(this) * f * PHYS_MAXSPEED(this) * PHYS_INPUT_TIMELENGTH; + wishspeed = max(curspeed, PHYS_MAXSPEED(this)) + PHYS_WARSOWBUNNY_ACCEL(this) * f * PHYS_MAXSPEED(this) * dt; } vector wishvel = wishdir * wishspeed; vector acceldir = wishvel - curvel; float addspeed = vlen(acceldir); acceldir = normalize(acceldir); - float accelspeed = min(addspeed, PHYS_WARSOWBUNNY_TURNACCEL(this) * PHYS_MAXSPEED(this) * PHYS_INPUT_TIMELENGTH); + float accelspeed = min(addspeed, PHYS_WARSOWBUNNY_TURNACCEL(this) * PHYS_MAXSPEED(this) * dt); if (PHYS_WARSOWBUNNY_BACKTOSIDERATIO(this) < 1) { @@ -579,12 +579,12 @@ void PM_check_nickspam(entity this) #endif } -void PM_check_punch(entity this) +void PM_check_punch(entity this, float dt) { #ifdef SVQC if (this.punchangle != '0 0 0') { - float f = vlen(this.punchangle) - 10 * PHYS_INPUT_TIMELENGTH; + float f = vlen(this.punchangle) - 10 * dt; if (f > 0) this.punchangle = normalize(this.punchangle) * f; else @@ -593,7 +593,7 @@ void PM_check_punch(entity this) if (this.punchvector != '0 0 0') { - float f = vlen(this.punchvector) - 30 * PHYS_INPUT_TIMELENGTH; + float f = vlen(this.punchvector) - 30 * dt; if (f > 0) this.punchvector = normalize(this.punchvector) * f; else @@ -683,7 +683,7 @@ void PM_check_blocked(entity this) .vector oldmovement; -void PM_jetpack(entity this, float maxspd_mod) +void PM_jetpack(entity this, float maxspd_mod, float dt) { //makevectors(this.v_angle.y * '0 1 0'); makevectors(this.v_angle); @@ -768,7 +768,7 @@ void PM_jetpack(entity this, float maxspd_mod) fvel = min(1, vlen(wishvel) / best); if (PHYS_JETPACK_FUEL(this) && !(ITEMS_STAT(this) & IT_UNLIMITED_WEAPON_AMMO)) - f = min(1, PHYS_AMMO_FUEL(this) / (PHYS_JETPACK_FUEL(this) * PHYS_INPUT_TIMELENGTH * fvel)); + f = min(1, PHYS_AMMO_FUEL(this) / (PHYS_JETPACK_FUEL(this) * dt * fvel)); else f = 1; @@ -776,12 +776,12 @@ void PM_jetpack(entity this, float maxspd_mod) if (f > 0 && wishvel != '0 0 0') { - this.velocity = this.velocity + wishvel * f * PHYS_INPUT_TIMELENGTH; + this.velocity = this.velocity + wishvel * f * dt; UNSET_ONGROUND(this); #ifdef SVQC if (!(ITEMS_STAT(this) & IT_UNLIMITED_WEAPON_AMMO)) - this.ammo_fuel -= PHYS_JETPACK_FUEL(this) * PHYS_INPUT_TIMELENGTH * fvel * f; + this.ammo_fuel -= PHYS_JETPACK_FUEL(this) * dt * fvel * f; ITEMS_STAT(this) |= IT_USING_JETPACK; diff --git a/qcsrc/common/physics/player.qh b/qcsrc/common/physics/player.qh index f120e9fe6..ae1bd8785 100644 --- a/qcsrc/common/physics/player.qh +++ b/qcsrc/common/physics/player.qh @@ -25,7 +25,7 @@ .vector v_angle_old; .string lastclassname; -.float(entity) PlayerPhysplug; +.float(entity,float) PlayerPhysplug; float AdjustAirAccelQW(float accelqw, float factor); bool IsFlying(entity a); diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index 79f1f216f..29658b56b 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -202,7 +202,7 @@ void turret_draw2d(entity this) ); } -void turret_construct(entity this) +void turret_construct(entity this, bool isnew) { entity tur = get_turretinfo(this.m_id); @@ -238,11 +238,16 @@ void turret_construct(entity this) this.tur_head.drawmask = MASK_NORMAL; this.anim_start_time = 0; this.draw2d = turret_draw2d; - IL_PUSH(g_drawables_2d, this); this.maxdistance = autocvar_g_waypointsprite_turrets_maxdist; this.teamradar_color = '1 0 0'; this.alpha = 1; + if(isnew) + { + IL_PUSH(g_drawables, this); + IL_PUSH(g_drawables_2d, this); + } + tur.tr_setup(tur, this); } @@ -370,7 +375,7 @@ NET_HANDLE(ENT_CLIENT_TURRET, bool isnew) this.angles_x = ReadAngle(); this.angles_y = ReadAngle(); - turret_construct(this); + turret_construct(this, isnew); this.colormap = 1024; this.glowmod = '0 1 1'; this.tur_head.colormap = this.colormap; diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 9f02cf21b..f7c5a5574 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -339,7 +339,7 @@ bool vehicle_addplayerslot( entity _owner, entity _slot, int _hud, Model _hud_model, - bool(entity) _framefunc, + bool(entity,float) _framefunc, void(entity,bool) _exitfunc, float(entity, entity) _enterfunc) { if(!(_owner.vehicle_flags & VHF_MULTISLOT)) diff --git a/qcsrc/common/vehicles/vehicle.qh b/qcsrc/common/vehicles/vehicle.qh index 927465ea6..7b1194e8e 100644 --- a/qcsrc/common/vehicles/vehicle.qh +++ b/qcsrc/common/vehicles/vehicle.qh @@ -24,7 +24,7 @@ CLASS(Vehicle, Object) /** cockpit model tag */ ATTRIB(Vehicle, tag_view, string, string_null) /** player physics mod */ - ATTRIB(Vehicle, PlayerPhysplug, bool(entity), func_null) + ATTRIB(Vehicle, PlayerPhysplug, bool(entity,float), func_null) /** */ ATTRIB(Vehicle, spawnflags, int, 0) /** vehicle hitbox size */ diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index 91964a9d5..3c0ccaabf 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -99,7 +99,7 @@ vector autocvar_g_vehicle_bumblebee_bouncepain = '1 100 200'; bool autocvar_g_vehicle_bumblebee = true; -bool bumblebee_gunner_frame(entity this) +bool bumblebee_gunner_frame(entity this, float dt) { entity vehic = this.vehicle.owner; entity gun = this.vehicle; @@ -394,28 +394,28 @@ void bumblebee_touch(entity this, entity toucher) vehicles_touch(this, toucher); } -void bumblebee_regen(entity this) +void bumblebee_regen(entity this, float dt) { if(this.gun1.delay + autocvar_g_vehicle_bumblebee_cannon_ammo_regen_pause < time) this.gun1.vehicle_energy = min(autocvar_g_vehicle_bumblebee_cannon_ammo, - this.gun1.vehicle_energy + autocvar_g_vehicle_bumblebee_cannon_ammo_regen * frametime); + this.gun1.vehicle_energy + autocvar_g_vehicle_bumblebee_cannon_ammo_regen * dt); if(this.gun2.delay + autocvar_g_vehicle_bumblebee_cannon_ammo_regen_pause < time) this.gun2.vehicle_energy = min(autocvar_g_vehicle_bumblebee_cannon_ammo, - this.gun2.vehicle_energy + autocvar_g_vehicle_bumblebee_cannon_ammo_regen * frametime); + this.gun2.vehicle_energy + autocvar_g_vehicle_bumblebee_cannon_ammo_regen * dt); if(this.vehicle_flags & VHF_SHIELDREGEN) - vehicles_regen(this, this.dmg_time, vehicle_shield, autocvar_g_vehicle_bumblebee_shield, autocvar_g_vehicle_bumblebee_shield_regen_pause, autocvar_g_vehicle_bumblebee_shield_regen, frametime, true); + vehicles_regen(this, this.dmg_time, vehicle_shield, autocvar_g_vehicle_bumblebee_shield, autocvar_g_vehicle_bumblebee_shield_regen_pause, autocvar_g_vehicle_bumblebee_shield_regen, dt, true); if(this.vehicle_flags & VHF_HEALTHREGEN) - vehicles_regen(this, this.dmg_time, vehicle_health, autocvar_g_vehicle_bumblebee_health, autocvar_g_vehicle_bumblebee_health_regen_pause, autocvar_g_vehicle_bumblebee_health_regen, frametime, false); + vehicles_regen(this, this.dmg_time, vehicle_health, autocvar_g_vehicle_bumblebee_health, autocvar_g_vehicle_bumblebee_health_regen_pause, autocvar_g_vehicle_bumblebee_health_regen, dt, false); if(this.vehicle_flags & VHF_ENERGYREGEN) - vehicles_regen(this, this.wait, vehicle_energy, autocvar_g_vehicle_bumblebee_energy, autocvar_g_vehicle_bumblebee_energy_regen_pause, autocvar_g_vehicle_bumblebee_energy_regen, frametime, false); + vehicles_regen(this, this.wait, vehicle_energy, autocvar_g_vehicle_bumblebee_energy, autocvar_g_vehicle_bumblebee_energy_regen_pause, autocvar_g_vehicle_bumblebee_energy_regen, dt, false); } -bool bumblebee_pilot_frame(entity this) +bool bumblebee_pilot_frame(entity this, float dt) { entity vehic = this.vehicle; return = true; @@ -435,7 +435,7 @@ bool bumblebee_pilot_frame(entity this) return; } - bumblebee_regen(vehic); + bumblebee_regen(vehic, dt); crosshair_trace(this); @@ -486,7 +486,7 @@ bool bumblebee_pilot_frame(entity this) else if(this.movement.y > 0) newvel += v_right * autocvar_g_vehicle_bumblebee_speed_strafe; ftmp = newvel * v_right; - ftmp *= frametime * 0.1; + ftmp *= dt * 0.1; vehic.angles_z = bound(-15, vehic.angles.z + ftmp, 15); } else @@ -501,7 +501,7 @@ bool bumblebee_pilot_frame(entity this) else if(PHYS_INPUT_BUTTON_JUMP(this)) newvel += v_up * autocvar_g_vehicle_bumblebee_speed_up; - vehic.velocity += newvel * frametime; + vehic.velocity += newvel * dt; this.velocity = this.movement = vehic.velocity; @@ -542,7 +542,7 @@ bool bumblebee_pilot_frame(entity this) autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides * -1, autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides, autocvar_g_vehicle_bumblebee_raygun_turnspeed); if(!forbidWeaponUse(this)) - if((PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_ATCK2(this)) && (vehic.vehicle_energy > autocvar_g_vehicle_bumblebee_raygun_dps * sys_frametime || autocvar_g_vehicle_bumblebee_raygun == 0)) + if((PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_ATCK2(this)) && (vehic.vehicle_energy > autocvar_g_vehicle_bumblebee_raygun_dps * PHYS_INPUT_FRAMETIME || autocvar_g_vehicle_bumblebee_raygun == 0)) { vehic.gun3.enemy.realowner = this; vehic.gun3.enemy.effects &= ~EF_NODRAW; @@ -556,8 +556,8 @@ bool bumblebee_pilot_frame(entity this) { if(autocvar_g_vehicle_bumblebee_raygun) { - Damage(trace_ent, vehic, this, autocvar_g_vehicle_bumblebee_raygun_dps * sys_frametime, DEATH_GENERIC.m_id, trace_endpos, v_forward * autocvar_g_vehicle_bumblebee_raygun_fps * sys_frametime); - vehic.vehicle_energy -= autocvar_g_vehicle_bumblebee_raygun_aps * sys_frametime; + Damage(trace_ent, vehic, this, autocvar_g_vehicle_bumblebee_raygun_dps * PHYS_INPUT_FRAMETIME, DEATH_GENERIC.m_id, trace_endpos, v_forward * autocvar_g_vehicle_bumblebee_raygun_fps * PHYS_INPUT_FRAMETIME); + vehic.vehicle_energy -= autocvar_g_vehicle_bumblebee_raygun_aps * PHYS_INPUT_FRAMETIME; } else { @@ -568,25 +568,25 @@ bool bumblebee_pilot_frame(entity this) if(IS_VEHICLE(trace_ent)) { if(autocvar_g_vehicle_bumblebee_healgun_sps && trace_ent.vehicle_health <= trace_ent.max_health) - trace_ent.vehicle_shield = min(trace_ent.vehicle_shield + autocvar_g_vehicle_bumblebee_healgun_sps * frametime, trace_ent.tur_head.max_health); + trace_ent.vehicle_shield = min(trace_ent.vehicle_shield + autocvar_g_vehicle_bumblebee_healgun_sps * dt, trace_ent.tur_head.max_health); if(autocvar_g_vehicle_bumblebee_healgun_hps) - trace_ent.vehicle_health = min(trace_ent.vehicle_health + autocvar_g_vehicle_bumblebee_healgun_hps * frametime, trace_ent.max_health); + trace_ent.vehicle_health = min(trace_ent.vehicle_health + autocvar_g_vehicle_bumblebee_healgun_hps * dt, trace_ent.max_health); } else if(IS_CLIENT(trace_ent)) { if(trace_ent.health <= autocvar_g_vehicle_bumblebee_healgun_hmax && autocvar_g_vehicle_bumblebee_healgun_hps) - trace_ent.health = min(trace_ent.health + autocvar_g_vehicle_bumblebee_healgun_hps * frametime, autocvar_g_vehicle_bumblebee_healgun_hmax); + trace_ent.health = min(trace_ent.health + autocvar_g_vehicle_bumblebee_healgun_hps * dt, autocvar_g_vehicle_bumblebee_healgun_hmax); if(trace_ent.armorvalue <= autocvar_g_vehicle_bumblebee_healgun_amax && autocvar_g_vehicle_bumblebee_healgun_aps) - trace_ent.armorvalue = min(trace_ent.armorvalue + autocvar_g_vehicle_bumblebee_healgun_aps * frametime, autocvar_g_vehicle_bumblebee_healgun_amax); + trace_ent.armorvalue = min(trace_ent.armorvalue + autocvar_g_vehicle_bumblebee_healgun_aps * dt, autocvar_g_vehicle_bumblebee_healgun_amax); - trace_ent.health = min(trace_ent.health + autocvar_g_vehicle_bumblebee_healgun_hps * frametime, autocvar_g_vehicle_bumblebee_healgun_hmax); + trace_ent.health = min(trace_ent.health + autocvar_g_vehicle_bumblebee_healgun_hps * dt, autocvar_g_vehicle_bumblebee_healgun_hmax); } else if(IS_TURRET(trace_ent)) { if(trace_ent.health <= trace_ent.max_health && autocvar_g_vehicle_bumblebee_healgun_hps) - trace_ent.health = min(trace_ent.health + autocvar_g_vehicle_bumblebee_healgun_hps * frametime, trace_ent.max_health); + trace_ent.health = min(trace_ent.health + autocvar_g_vehicle_bumblebee_healgun_hps * dt, trace_ent.max_health); //else ..hmmm what? ammo? trace_ent.SendFlags |= TNSF_STATUS; @@ -633,7 +633,7 @@ void bumblebee_land(entity this) float hgt; hgt = vehicle_altitude(this, 512); - this.velocity = (this.velocity * 0.9) + ('0 0 -1800' * (hgt / 256) * sys_frametime); + this.velocity = (this.velocity * 0.9) + ('0 0 -1800' * (hgt / 256) * PHYS_INPUT_FRAMETIME); this.angles_x *= 0.95; this.angles_z *= 0.95; diff --git a/qcsrc/common/vehicles/vehicle/racer.qc b/qcsrc/common/vehicles/vehicle/racer.qc index 367e8b7e4..2bccec21a 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qc +++ b/qcsrc/common/vehicles/vehicle/racer.qc @@ -170,7 +170,7 @@ void racer_fire_rocket_aim(entity player, string tagname, entity trg) racer_fire_rocket(player, v, v_forward, trg); } -bool racer_frame(entity this) +bool racer_frame(entity this, float dt) { entity vehic = this.vehicle; return = true; @@ -195,22 +195,22 @@ bool racer_frame(entity this) return; } - racer_align4point(vehic, PHYS_INPUT_TIMELENGTH); + racer_align4point(vehic, dt); PHYS_INPUT_BUTTON_ZOOM(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false; vehic.angles_x *= -1; // Yaw - float ftmp = autocvar_g_vehicle_racer_turnspeed * PHYS_INPUT_TIMELENGTH; + float ftmp = autocvar_g_vehicle_racer_turnspeed * dt; ftmp = bound(-ftmp, shortangle_f(this.v_angle_y - vehic.angles_y, vehic.angles_y), ftmp); vehic.angles_y = anglemods(vehic.angles_y + ftmp); // Roll - vehic.angles_z += -ftmp * autocvar_g_vehicle_racer_turnroll * PHYS_INPUT_TIMELENGTH; + vehic.angles_z += -ftmp * autocvar_g_vehicle_racer_turnroll * dt; // Pitch - ftmp = autocvar_g_vehicle_racer_pitchspeed * PHYS_INPUT_TIMELENGTH; + ftmp = autocvar_g_vehicle_racer_pitchspeed * dt; ftmp = bound(-ftmp, shortangle_f(this.v_angle_x - vehic.angles_x, vehic.angles_x), ftmp); vehic.angles_x = bound(-autocvar_g_vehicle_racer_pitchlimit, anglemods(vehic.angles_x + ftmp), autocvar_g_vehicle_racer_pitchlimit); @@ -256,7 +256,7 @@ bool racer_frame(entity this) #endif // Afterburn - if (PHYS_INPUT_BUTTON_JUMP(this) && vehic.vehicle_energy >= (autocvar_g_vehicle_racer_afterburn_cost * PHYS_INPUT_TIMELENGTH)) + if (PHYS_INPUT_BUTTON_JUMP(this) && vehic.vehicle_energy >= (autocvar_g_vehicle_racer_afterburn_cost * dt)) { #ifdef SVQC if(time - vehic.wait > 0.2) @@ -267,12 +267,12 @@ bool racer_frame(entity this) if(cont & DPCONTENTS_LIQUIDSMASK) { - vehic.vehicle_energy -= autocvar_g_vehicle_racer_waterburn_cost * PHYS_INPUT_TIMELENGTH; + vehic.vehicle_energy -= autocvar_g_vehicle_racer_waterburn_cost * dt; df += (v_forward * autocvar_g_vehicle_racer_waterburn_speed); } else { - vehic.vehicle_energy -= autocvar_g_vehicle_racer_afterburn_cost * PHYS_INPUT_TIMELENGTH; + vehic.vehicle_energy -= autocvar_g_vehicle_racer_afterburn_cost * dt; df += (v_forward * autocvar_g_vehicle_racer_speed_afterburn); } @@ -307,7 +307,7 @@ bool racer_frame(entity this) dforce = autocvar_g_vehicle_racer_water_downforce; df -= v_up * (vlen(vehic.velocity) * dforce); - this.movement = vehic.velocity += df * PHYS_INPUT_TIMELENGTH; + this.movement = vehic.velocity += df * dt; #ifdef SVQC @@ -335,8 +335,8 @@ bool racer_frame(entity this) { crosshair_trace(this); - vehicles_locktarget(vehic, (1 / autocvar_g_vehicle_racer_rocket_locking_time) * frametime, - (1 / autocvar_g_vehicle_racer_rocket_locking_releasetime) * frametime, + vehicles_locktarget(vehic, (1 / autocvar_g_vehicle_racer_rocket_locking_time) * dt, + (1 / autocvar_g_vehicle_racer_rocket_locking_releasetime) * dt, autocvar_g_vehicle_racer_rocket_locked_time); vehic.vehicle_last_trace = time + autocvar_g_vehicle_racer_thinkrate; @@ -382,13 +382,13 @@ bool racer_frame(entity this) this.vehicle_reload2 = bound(0, 100 * ((time - vehic.lip) / (vehic.delay - vehic.lip)), 100); if(vehic.vehicle_flags & VHF_SHIELDREGEN) - vehicles_regen(vehic, vehic.dmg_time, vehicle_shield, autocvar_g_vehicle_racer_shield, autocvar_g_vehicle_racer_shield_regen_pause, autocvar_g_vehicle_racer_shield_regen, frametime, true); + vehicles_regen(vehic, vehic.dmg_time, vehicle_shield, autocvar_g_vehicle_racer_shield, autocvar_g_vehicle_racer_shield_regen_pause, autocvar_g_vehicle_racer_shield_regen, dt, true); if(vehic.vehicle_flags & VHF_HEALTHREGEN) - vehicles_regen(vehic, vehic.dmg_time, vehicle_health, autocvar_g_vehicle_racer_health, autocvar_g_vehicle_racer_health_regen_pause, autocvar_g_vehicle_racer_health_regen, frametime, false); + vehicles_regen(vehic, vehic.dmg_time, vehicle_health, autocvar_g_vehicle_racer_health, autocvar_g_vehicle_racer_health_regen_pause, autocvar_g_vehicle_racer_health_regen, dt, false); if(vehic.vehicle_flags & VHF_ENERGYREGEN) - vehicles_regen(vehic, vehic.wait, vehicle_energy, autocvar_g_vehicle_racer_energy, autocvar_g_vehicle_racer_energy_regen_pause, autocvar_g_vehicle_racer_energy_regen, frametime, false); + vehicles_regen(vehic, vehic.wait, vehicle_energy, autocvar_g_vehicle_racer_energy, autocvar_g_vehicle_racer_energy_regen_pause, autocvar_g_vehicle_racer_energy_regen, dt, false); VEHICLE_UPDATE_PLAYER(this, vehic, health, racer); VEHICLE_UPDATE_PLAYER(this, vehic, energy, racer); diff --git a/qcsrc/common/vehicles/vehicle/raptor.qc b/qcsrc/common/vehicles/vehicle/raptor.qc index 6b33f8c1a..510f63ba1 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qc +++ b/qcsrc/common/vehicles/vehicle/raptor.qc @@ -84,7 +84,7 @@ void raptor_land(entity this) float hgt; hgt = vehicle_altitude(this, 512); - this.velocity = (this.velocity * 0.9) + ('0 0 -1800' * (hgt / 256) * sys_frametime); + this.velocity = (this.velocity * 0.9) + ('0 0 -1800' * (hgt / 256) * PHYS_INPUT_FRAMETIME); this.angles_x *= 0.95; this.angles_z *= 0.95; @@ -153,7 +153,7 @@ void raptor_exit(entity this, int eject) this.owner = NULL; } -bool raptor_frame(entity this) +bool raptor_frame(entity this, float dt) { entity vehic = this.vehicle; return = true; @@ -273,7 +273,7 @@ bool raptor_frame(entity this) else if (PHYS_INPUT_BUTTON_JUMP(this)) df += v_up * autocvar_g_vehicle_raptor_speed_up; - vehic.velocity += df * frametime; + vehic.velocity += df * dt; this.velocity = this.movement = vehic.velocity; setorigin(this, vehic.origin + '0 0 32'); @@ -331,8 +331,8 @@ bool raptor_frame(entity this) else if(autocvar_g_vehicle_raptor_cannon_locktarget == 1) { - vehicles_locktarget(vehic, (1 / autocvar_g_vehicle_raptor_cannon_locking_time) * frametime, - (1 / autocvar_g_vehicle_raptor_cannon_locking_releasetime) * frametime, + vehicles_locktarget(vehic, (1 / autocvar_g_vehicle_raptor_cannon_locking_time) * dt, + (1 / autocvar_g_vehicle_raptor_cannon_locking_releasetime) * dt, autocvar_g_vehicle_raptor_cannon_locked_time); if(vehic.lock_target != NULL) @@ -389,13 +389,13 @@ bool raptor_frame(entity this) } if(vehic.vehicle_flags & VHF_SHIELDREGEN) - vehicles_regen(vehic, vehic.dmg_time, vehicle_shield, autocvar_g_vehicle_raptor_shield, autocvar_g_vehicle_raptor_shield_regen_pause, autocvar_g_vehicle_raptor_shield_regen, frametime, true); + vehicles_regen(vehic, vehic.dmg_time, vehicle_shield, autocvar_g_vehicle_raptor_shield, autocvar_g_vehicle_raptor_shield_regen_pause, autocvar_g_vehicle_raptor_shield_regen, dt, true); if(vehic.vehicle_flags & VHF_HEALTHREGEN) - vehicles_regen(vehic, vehic.dmg_time, vehicle_health, autocvar_g_vehicle_raptor_health, autocvar_g_vehicle_raptor_health_regen_pause, autocvar_g_vehicle_raptor_health_regen, frametime, false); + vehicles_regen(vehic, vehic.dmg_time, vehicle_health, autocvar_g_vehicle_raptor_health, autocvar_g_vehicle_raptor_health_regen_pause, autocvar_g_vehicle_raptor_health_regen, dt, false); if(vehic.vehicle_flags & VHF_ENERGYREGEN) - vehicles_regen(vehic, vehic.cnt, vehicle_energy, autocvar_g_vehicle_raptor_energy, autocvar_g_vehicle_raptor_energy_regen_pause, autocvar_g_vehicle_raptor_energy_regen, frametime, false); + vehicles_regen(vehic, vehic.cnt, vehicle_energy, autocvar_g_vehicle_raptor_energy, autocvar_g_vehicle_raptor_energy_regen_pause, autocvar_g_vehicle_raptor_energy_regen, dt, false); Weapon wep2a = WEP_RAPTOR_BOMB; if(!forbidWeaponUse(this)) @@ -458,7 +458,7 @@ bool raptor_frame(entity this) PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false; } -bool raptor_takeoff(entity this) +bool raptor_takeoff(entity this, float dt) { entity vehic = this.vehicle; return = true; @@ -476,7 +476,7 @@ bool raptor_takeoff(entity this) // Takeoff sequense if(vehic.frame < 25) { - vehic.frame += 25 / (autocvar_g_vehicle_raptor_takeofftime / sys_frametime); + vehic.frame += 25 / (autocvar_g_vehicle_raptor_takeofftime / PHYS_INPUT_FRAMETIME); vehic.velocity_z = min(vehic.velocity_z * 1.5, 256); vehic.bomb1.gun1.avelocity_y = 90 + ((vehic.frame / 25) * 25000); vehic.bomb1.gun2.avelocity_y = -vehic.bomb1.gun1.avelocity_y; @@ -488,13 +488,13 @@ bool raptor_takeoff(entity this) this.PlayerPhysplug = raptor_frame; if(vehic.vehicle_flags & VHF_SHIELDREGEN) - vehicles_regen(vehic, vehic.dmg_time, vehicle_shield, autocvar_g_vehicle_raptor_shield, autocvar_g_vehicle_raptor_shield_regen_pause, autocvar_g_vehicle_raptor_shield_regen, frametime, true); + vehicles_regen(vehic, vehic.dmg_time, vehicle_shield, autocvar_g_vehicle_raptor_shield, autocvar_g_vehicle_raptor_shield_regen_pause, autocvar_g_vehicle_raptor_shield_regen, dt, true); if(vehic.vehicle_flags & VHF_HEALTHREGEN) - vehicles_regen(vehic, vehic.dmg_time, vehicle_health, autocvar_g_vehicle_raptor_health, autocvar_g_vehicle_raptor_health_regen_pause, autocvar_g_vehicle_raptor_health_regen, frametime, false); + vehicles_regen(vehic, vehic.dmg_time, vehicle_health, autocvar_g_vehicle_raptor_health, autocvar_g_vehicle_raptor_health_regen_pause, autocvar_g_vehicle_raptor_health_regen, dt, false); if(vehic.vehicle_flags & VHF_ENERGYREGEN) - vehicles_regen(vehic, vehic.cnt, vehicle_energy, autocvar_g_vehicle_raptor_energy, autocvar_g_vehicle_raptor_energy_regen_pause, autocvar_g_vehicle_raptor_energy_regen, frametime, false); + vehicles_regen(vehic, vehic.cnt, vehicle_energy, autocvar_g_vehicle_raptor_energy, autocvar_g_vehicle_raptor_energy_regen_pause, autocvar_g_vehicle_raptor_energy_regen, dt, false); vehic.bomb1.alpha = vehic.bomb2.alpha = (time - vehic.lip) / (vehic.delay - vehic.lip); diff --git a/qcsrc/common/vehicles/vehicle/spiderbot.qc b/qcsrc/common/vehicles/vehicle/spiderbot.qc index 80d26fc2f..3365266f8 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot.qc @@ -68,7 +68,7 @@ float autocvar_g_vehicle_spiderbot_shield_regen_pause = 0.35; vector autocvar_g_vehicle_spiderbot_bouncepain = '0 0 0'; .float jump_delay; -bool spiderbot_frame(entity this) +bool spiderbot_frame(entity this, float dt) { entity vehic = this.vehicle; return = true; @@ -116,7 +116,7 @@ bool spiderbot_frame(entity this) //UpdateAuxiliaryXhair(this, trace_endpos, ('1 0 0' * this.vehicle_reload2) + ('0 1 0' * (1 - this.vehicle_reload2)), 2); // Rotate head - float ftmp = autocvar_g_vehicle_spiderbot_head_turnspeed * sys_frametime; + float ftmp = autocvar_g_vehicle_spiderbot_head_turnspeed * PHYS_INPUT_FRAMETIME; ad_y = bound(-ftmp, ad_y, ftmp); vehic.tur_head.angles_y = bound(autocvar_g_vehicle_spiderbot_head_turnlimit * -1, vehic.tur_head.angles_y + ad_y, autocvar_g_vehicle_spiderbot_head_turnlimit); @@ -193,9 +193,9 @@ bool spiderbot_frame(entity this) { // Turn Body if(this.movement_x == 0 && this.movement_y != 0) - ftmp = autocvar_g_vehicle_spiderbot_turnspeed_strafe * sys_frametime; + ftmp = autocvar_g_vehicle_spiderbot_turnspeed_strafe * PHYS_INPUT_FRAMETIME; else - ftmp = autocvar_g_vehicle_spiderbot_turnspeed * sys_frametime; + ftmp = autocvar_g_vehicle_spiderbot_turnspeed * PHYS_INPUT_FRAMETIME; ftmp = bound(-ftmp, vehic.tur_head.angles_y, ftmp); vehic.angles_y = anglemods(vehic.angles_y + ftmp); @@ -221,7 +221,7 @@ bool spiderbot_frame(entity this) vehic.velocity_z = oldvelz; float g = ((autocvar_sv_gameplayfix_gravityunaffectedbyticrate) ? 0.5 : 1); if(vehic.velocity_z <= 20) // not while jumping - vehic.velocity_z -= g * sys_frametime * autocvar_sv_gravity; + vehic.velocity_z -= g * PHYS_INPUT_FRAMETIME * autocvar_sv_gravity; if(IS_ONGROUND(vehic)) if(vehic.sound_nexttime < time || vehic.delay != 1) { @@ -251,7 +251,7 @@ bool spiderbot_frame(entity this) vehic.velocity_z = oldvelz; float g = ((autocvar_sv_gameplayfix_gravityunaffectedbyticrate) ? 0.5 : 1); if(vehic.velocity_z <= 20) // not while jumping - vehic.velocity_z -= g * sys_frametime * autocvar_sv_gravity; + vehic.velocity_z -= g * PHYS_INPUT_FRAMETIME * autocvar_sv_gravity; if(IS_ONGROUND(vehic)) if(vehic.sound_nexttime < time || vehic.delay != 2) { @@ -306,16 +306,16 @@ bool spiderbot_frame(entity this) else vehicles_regen(vehic, vehic.cnt, vehicle_ammo1, autocvar_g_vehicle_spiderbot_minigun_ammo_max, autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause, - autocvar_g_vehicle_spiderbot_minigun_ammo_regen, frametime, false); + autocvar_g_vehicle_spiderbot_minigun_ammo_regen, dt, false); spiderbot_rocket_do(vehic); if(vehic.vehicle_flags & VHF_SHIELDREGEN) - vehicles_regen(vehic, vehic.dmg_time, vehicle_shield, autocvar_g_vehicle_spiderbot_shield, autocvar_g_vehicle_spiderbot_shield_regen_pause, autocvar_g_vehicle_spiderbot_shield_regen, frametime, true); + vehicles_regen(vehic, vehic.dmg_time, vehicle_shield, autocvar_g_vehicle_spiderbot_shield, autocvar_g_vehicle_spiderbot_shield_regen_pause, autocvar_g_vehicle_spiderbot_shield_regen, dt, true); if(vehic.vehicle_flags & VHF_HEALTHREGEN) - vehicles_regen(vehic, vehic.dmg_time, vehicle_health, autocvar_g_vehicle_spiderbot_health, autocvar_g_vehicle_spiderbot_health_regen_pause, autocvar_g_vehicle_spiderbot_health_regen, frametime, false); + vehicles_regen(vehic, vehic.dmg_time, vehicle_health, autocvar_g_vehicle_spiderbot_health, autocvar_g_vehicle_spiderbot_health_regen_pause, autocvar_g_vehicle_spiderbot_health_regen, dt, false); PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = false; //this.vehicle_ammo2 = vehic.tur_head.frame; diff --git a/qcsrc/ecs/systems/cl_physics.qc b/qcsrc/ecs/systems/cl_physics.qc index 206c80d96..f90afcb52 100644 --- a/qcsrc/ecs/systems/cl_physics.qc +++ b/qcsrc/ecs/systems/cl_physics.qc @@ -13,13 +13,13 @@ void sys_phys_fix(entity this, float dt) PM_ClientMovement_UpdateStatus(this); } -bool sys_phys_override(entity this) +bool sys_phys_override(entity this, float dt) { // no vehicle prediction return hud != HUD_NORMAL; } -void sys_phys_monitor(entity this) {} +void sys_phys_monitor(entity this, float dt) {} void sys_phys_ai(entity this) {} diff --git a/qcsrc/ecs/systems/physics.qc b/qcsrc/ecs/systems/physics.qc index 0a8cd8ef3..c0a47e39b 100644 --- a/qcsrc/ecs/systems/physics.qc +++ b/qcsrc/ecs/systems/physics.qc @@ -15,7 +15,7 @@ void sys_phys_update(entity this, float dt) sys_in_update(this, dt); sys_phys_fix(this, dt); - if (sys_phys_override(this)) { return; } sys_phys_monitor(this); + if (sys_phys_override(this, dt)) { return; } sys_phys_monitor(this, dt); this.buttons_old = PHYS_INPUT_BUTTON_MASK(this); this.movement_old = this.movement; @@ -41,7 +41,7 @@ void sys_phys_update(entity this, float dt) // conveyors: first fix velocity if (this.conveyor.state) { this.velocity -= this.conveyor.movedir; } - MUTATOR_CALLHOOK(PlayerPhysics, this); + MUTATOR_CALLHOOK(PlayerPhysics, this, dt); if (!IS_PLAYER(this)) { sys_phys_spectator_control(this); @@ -115,7 +115,7 @@ void sys_phys_update(entity this, float dt) this.com_phys_ladder = false; this.com_phys_gravity = '0 0 0'; } else if (ITEMS_STAT(this) & IT_USING_JETPACK) { - PM_jetpack(this, maxspeed_mod); + PM_jetpack(this, maxspeed_mod, dt); } else if (IS_ONGROUND(this)) { if (!WAS_ONGROUND(this)) { emit(phys_land, this); @@ -263,7 +263,7 @@ void sys_phys_simulate(entity this, float dt) airaccel += (this.com_phys_acc_rate_air_stop - airaccel) * max(0, -(curdir * wishdir)); } // note that for straight forward jumping: - // step = accel * PHYS_INPUT_TIMELENGTH * wishspeed0; + // step = accel * dt * wishspeed0; // accel = bound(0, wishspeed - vel_xy_current, step) * accelqw + step * (1 - accelqw); // --> // dv/dt = accel * maxspeed (when slow) @@ -288,15 +288,15 @@ void sys_phys_simulate(entity this, float dt) // !CPM if (PHYS_WARSOWBUNNY_TURNACCEL(this) && accelerating && this.movement.y == 0 && this.movement.x != 0) { - PM_AirAccelerate(this, wishdir, wishspeed2); + PM_AirAccelerate(this, dt, wishdir, wishspeed2); } else { float sidefric = maxairspd ? (PHYS_AIRACCEL_SIDEWAYS_FRICTION(this) / maxairspd) : 0; - PM_Accelerate(this, wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, + PM_Accelerate(this, dt, wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, PHYS_AIRACCEL_QW_STRETCHFACTOR(this), sidefric, PHYS_AIRSPEEDLIMIT_NONQW(this)); } if (PHYS_AIRCONTROL(this)) { - CPM_PM_Aircontrol(this, wishdir, wishspeed2); + CPM_PM_Aircontrol(this, dt, wishdir, wishspeed2); } } } else { @@ -338,7 +338,7 @@ void sys_phys_simulate(entity this, float dt) } } else { // water acceleration - PM_Accelerate(this, wishdir, wishspeed, wishspeed, this.com_phys_acc_rate, 1, 0, 0, 0); + PM_Accelerate(this, dt, wishdir, wishspeed, wishspeed, this.com_phys_acc_rate, 1, 0, 0, 0); } return; } @@ -391,7 +391,7 @@ void sys_phys_simulate(entity this, float dt) } if (IS_CSQC ? PHYS_WATERJUMP_TIME(this) <= 0 : time >= PHYS_TELEPORT_TIME(this)) { - PM_Accelerate(this, wishdir, wishspeed, wishspeed, this.com_phys_acc_rate, 1, 0, 0, 0); + PM_Accelerate(this, dt, wishdir, wishspeed, wishspeed, this.com_phys_acc_rate, 1, 0, 0, 0); } } } diff --git a/qcsrc/ecs/systems/physics.qh b/qcsrc/ecs/systems/physics.qh index 16c996ade..cef9916f3 100644 --- a/qcsrc/ecs/systems/physics.qh +++ b/qcsrc/ecs/systems/physics.qh @@ -3,8 +3,8 @@ SYSTEM(phys, 30, 10); void sys_phys_fix(entity this, float dt); -bool sys_phys_override(entity this); -void sys_phys_monitor(entity this); +bool sys_phys_override(entity this, float dt); +void sys_phys_monitor(entity this, float dt); void sys_phys_pregame_hold(entity this); void sys_phys_ai(entity this); void sys_phys_spectator_control(entity this); diff --git a/qcsrc/ecs/systems/sv_physics.qc b/qcsrc/ecs/systems/sv_physics.qc index fe053a22e..904ebba3f 100644 --- a/qcsrc/ecs/systems/sv_physics.qc +++ b/qcsrc/ecs/systems/sv_physics.qc @@ -6,15 +6,15 @@ void sys_phys_fix(entity this, float dt) Physics_UpdateStats(this, PHYS_HIGHSPEED(this)); } -bool sys_phys_override(entity this) +bool sys_phys_override(entity this, float dt) { int buttons = PHYS_INPUT_BUTTON_MASK(this); if (PM_check_specialcommand(this, buttons)) { return true; } - if (this.PlayerPhysplug && this.PlayerPhysplug(this)) { return true; } + if (this.PlayerPhysplug && this.PlayerPhysplug(this, dt)) { return true; } return false; } -void sys_phys_monitor(entity this) +void sys_phys_monitor(entity this, float dt) { int buttons = PHYS_INPUT_BUTTON_MASK(this); anticheat_physics(this); @@ -24,7 +24,7 @@ void sys_phys_monitor(entity this) || this.v_angle != this.v_angle_old) { this.parm_idlesince = time; } } PM_check_nickspam(this); - PM_check_punch(this); + PM_check_punch(this, dt); } void sys_phys_ai(entity this) diff --git a/qcsrc/server/mutators/mutator/gamemode_cts.qc b/qcsrc/server/mutators/mutator/gamemode_cts.qc index 8efa3a35d..28ec506a8 100644 --- a/qcsrc/server/mutators/mutator/gamemode_cts.qc +++ b/qcsrc/server/mutators/mutator/gamemode_cts.qc @@ -108,8 +108,9 @@ void CTS_ClientKill(entity e) // silent version of ClientKill, used when player MUTATOR_HOOKFUNCTION(cts, PlayerPhysics) { entity player = M_ARGV(0, entity); + float dt = M_ARGV(1, float); - player.race_movetime_frac += PHYS_INPUT_TIMELENGTH; + player.race_movetime_frac += dt; float f = floor(player.race_movetime_frac); player.race_movetime_frac -= f; player.race_movetime_count += f; diff --git a/qcsrc/server/mutators/mutator/gamemode_race.qc b/qcsrc/server/mutators/mutator/gamemode_race.qc index a496ef2e2..d9da5b86c 100644 --- a/qcsrc/server/mutators/mutator/gamemode_race.qc +++ b/qcsrc/server/mutators/mutator/gamemode_race.qc @@ -143,8 +143,9 @@ float WinningCondition_QualifyingThenRace(float limit) MUTATOR_HOOKFUNCTION(rc, PlayerPhysics) { entity player = M_ARGV(0, entity); + float dt = M_ARGV(1, float); - player.race_movetime_frac += PHYS_INPUT_TIMELENGTH; + player.race_movetime_frac += dt; float f = floor(player.race_movetime_frac); player.race_movetime_frac -= f; player.race_movetime_count += f; -- 2.39.2