Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions csqc/pmove.qc
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
DEFCVAR_FLOAT(fo_jumpvolume, 1);

static float pm_enabled;
inline float PM_Enabled() { return pm_enabled; }

#define STEPTIME 0.125

enumflags {
Expand Down Expand Up @@ -482,7 +479,8 @@ void PM_AddSimExplosion(float itime, entity ent) {
if (!PM_Enabled())
return;

if (ent.owner != pengine.player_ent) // Just player ents in version 0
if ((CVARF(fo_beta_nudge_explosion) & 2 == 0) &&
ent.owner != pengine.player_ent)
return;

float dmg = 0;
Expand Down Expand Up @@ -603,7 +601,7 @@ static void PM_RunMovement(PMS_Data* pmsd, float endframe) {
}

static void PM_SetEnabled(float enabled) {
pm_enabled = enabled;
pengine.pm_enabled = enabled;

PM_Refresh();

Expand Down
9 changes: 7 additions & 2 deletions csqc/weapon_predict.qc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ static float wp_ready;
struct pengine_t {
float pp_enabled;
float wp_enabled;
float pm_enabled;
float is_effectframe;
float last_effectframe;

Expand All @@ -52,6 +53,8 @@ inline float PP_Enabled() { return pengine.pp_enabled; }
inline float WP_Enabled() { return pengine.wp_enabled; }
inline float WPP_ViewModelMask() { return pengine.view_mask; }

inline float PM_Enabled() { return pengine.pm_enabled; }

float WP_PlayerClass() {
return pstate_server.playerclass;
}
Expand Down Expand Up @@ -606,8 +609,8 @@ void WP_ServerUpdate(float sendflags) {
pstate_server.weaponframe += 1;
}

if (CVARF(fo_beta_nudge_explosion))
phys_sim_dt = (pstate_server.client_ping + 4 * SERVER_FRAME_MS) / 1000.0;
if (PM_Enabled())
phys_sim_dt = 3 * SERVER_FRAME_DT;
else
phys_sim_dt = -1;

Expand Down Expand Up @@ -1299,6 +1302,8 @@ inline float get_phys_time(entity e) {
// this will offset explosions in the short term).
static float last_self_time;
float dt = min(inst_ping_ms, CVARF(wpp_adv_otherp_ms)) / 1000.0;
if (PM_Enabled() && (CVARF(fo_beta_nudge_explosion) & 2))
dt = (clientcommandframe - servercommandframe - 1) * SERVER_FRAME_DT;
last_self_time = max(last_self_time, time + dt);
return last_self_time;
}
Expand Down
4 changes: 3 additions & 1 deletion share/physics.qc
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,13 @@ float Phys_Init(entity e, float target_time, float delta, float phys_flags) {
#ifdef CSQC
void Phys_Sim(entity e, float target_time = 0) {
// TODO: Unvoid+undo if we make it past the void point.
if (phys_sim_dt < 0 || e.phys_sim_voided_at)
if (e.phys_sim_voided_at)
return;

float min_gran = 0;
if (!target_time) {
if (phys_sim_dt < 0)
return;
target_time = time + phys_sim_dt;
min_gran = SERVER_FRAME_DT;
}
Expand Down