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
13 changes: 7 additions & 6 deletions csqc/pmove.qc
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ static float nudge_expired(PM_Nudge* n) {

switch (n->nat) {
case NA_NONE: return TRUE;
case NA_SEQ: return n->seq >= servercommandframe;
case NA_SEQTIME: return n->seq + ceil(n->itime / SERVER_FRAME_DT) >= servercommandframe;
case NA_ITIME: return n->itime >= pstate_server.server_time + NUDGE_EPS; // Slack
case NA_SEQ: return n->seq <= servercommandframe;
case NA_SEQTIME: return n->seq + ceil(n->itime / SERVER_FRAME_DT) <= servercommandframe;
case NA_ITIME: return n->itime - NUDGE_EPS <= pstate_server.server_time; // Slack
case NA_CONC: return n->itime <= pstate_server.conc_state.next;
}

Expand Down Expand Up @@ -352,15 +352,16 @@ static void PM_NudgeDash(PM_Nudge* nudge, entity ent) {
ent.velocity = nudge->vec;
}

void PM_AddNudgeDash(float itime) {
void PM_AddNudgeDash(float cseq) {
PM_Nudge* n = find_nudge_slot();
if (!n)
return;
n->type = NT_DASH;
n->itime = itime;
n->nat = NA_SEQ;
n->seq = cseq;

n->vec = v_forward * 540;
n->vec.z = 181 + SERVER_FRAME_DT * 800; // TODO: fix this...
n->vec.z = 181;
}

float nudge_i(PM_Nudge* n) {
Expand Down
5 changes: 2 additions & 3 deletions csqc/weapon_predict.qc
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ void WP_HandleGrenadeInputs() {
}

float PM_Enabled();
void PM_AddDashNudge(float itime);
void PM_AddNudgeDash(float cseq);

static void WP_Special() {
if (pstate_pred.server_time < pstate_pred.special_next)
Expand All @@ -914,8 +914,7 @@ static void WP_Special() {
case PC_SCOUT:
cooldown = 1;
if (PM_Enabled() && IsEffectFrame()) {
// Want to land in this frame
PM_AddDashNudge(pstate_pred.server_time - 1 * MSEC);
PM_AddNudgeDash(pstate_pred.seq);
localsound("dash.wav", CHAN_BODY, 1);
}
break;
Expand Down