diff options
author | IronClawTrem <louie.nutman@gmail.com> | 2020-03-07 17:53:19 +0000 |
---|---|---|
committer | IronClawTrem <louie.nutman@gmail.com> | 2020-03-07 17:53:19 +0000 |
commit | dfb61191ce637adcff4129e5edef0484ec6338b7 (patch) | |
tree | a076d84a541f4f90062b88f7c8f5d4fd5fb6c5df | |
parent | 36c34416af9974798a7cb60cf27dcf2c7ec17c6d (diff) |
fix cg_projectileNudge in demos and allow user-defined nudge values
-rw-r--r-- | src/cgame/cg_ents.c | 19 |
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 |