summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIronClawTrem <louie.nutman@gmail.com>2020-01-24 19:27:09 +0000
committerIronClawTrem <louie.nutman@gmail.com>2020-01-24 19:27:09 +0000
commit09a55891d7e2ea56ba3372fef5644016d9953342 (patch)
treec561fbecb805044d0445a3889066bc3d0f5514b6
parentbdaa5d9bd4738bda5ef5a88e504afe1b062e27d4 (diff)
fix cg_projectileNudge in demos and allow user-defined nudge values
-rw-r--r--src/cgame/cg_ents.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c
index 17f1a7d..61b1acf 100644
--- a/src/cgame/cg_ents.c
+++ b/src/cgame/cg_ents.c
@@ -947,11 +947,22 @@ static void CG_CalcEntityLerpPositions( centity_t *cent )
return;
}
- if( cg_projectileNudge.integer > 0 &&
- cent->currentState.eType == ET_MISSILE &&
- !( cg.snap->ps.pm_flags & PMF_FOLLOW ) )
+ // cg_projectileNudge:
+ // 0 = no nudge
+ // 1 = ping based nudge only if unlagged and not playing a demo
+ // 2 = ping based nudge
+ // other = custom nudge
+ if( cg_projectileNudge.integer != 0 &&
+ cent->currentState.eType == ET_MISSILE &&
+ !( cg.snap->ps.pm_flags & PMF_FOLLOW ) )
{
- timeshift = cg.ping;
+ if( cg_projectileNudge.integer == 1 )
+ if( cg_unlagged.integer && !cg.demoPlayback )
+ timeshift = cg.ping;
+ else if ( cg_projectileNudge.integer == 2 )
+ timeshift = cg.ping;
+ else
+ timeshift = cg_projectileNudge.integer;
}
// just use the current frame and evaluate as best we can