From dfb61191ce637adcff4129e5edef0484ec6338b7 Mon Sep 17 00:00:00 2001 From: IronClawTrem Date: Sat, 7 Mar 2020 17:53:19 +0000 Subject: fix cg_projectileNudge in demos and allow user-defined nudge values --- src/cgame/cg_ents.c | 19 +++++++++++++++---- 1 file 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 -- cgit