# HG changeset patch # User Adam Kaminski # Date 1637509576 18000 # Sun Nov 21 10:46:16 2021 -0500 # Node ID 6c0af85faf2befac6d4225b36e1e02f23465f19e # Parent 06418ca8f9391668abf0d11ef91d8ccb11f439b4 - A player's weapon sprites are no longer cycled while being extrapolated, but now do during a backtrace. - Added a new member in secplane_t: "backtraceRestoreD", to save the floor/ceiling heights of all sectors before a backtrace is performed so that they're restored properly without interference due to unlagged reconciliation. diff -r 06418ca8f939 -r 6c0af85faf2b src/p_user.cpp --- a/src/p_user.cpp Fri Nov 19 23:07:16 2021 -0500 +++ b/src/p_user.cpp Sun Nov 21 10:46:16 2021 -0500 @@ -3862,13 +3862,15 @@ } } + // Cycle psprites + // [AK] Don't do this while extrapolating the player's movement. + if ( SERVER_IsExtrapolatingPlayer( player - players ) == false ) + P_MovePsprites (player); + // [AK] Stop here if we're backtracing the player's movement. if ( SERVER_IsBacktracingPlayer( player - players )) return; - // Cycle psprites - P_MovePsprites (player); - // Other Counters if (player->damagecount) player->damagecount--; diff -r 06418ca8f939 -r 6c0af85faf2b src/r_defs.h --- a/src/r_defs.h Fri Nov 19 23:07:16 2021 -0500 +++ b/src/r_defs.h Sun Nov 21 10:46:16 2021 -0500 @@ -251,6 +251,9 @@ fixed_t unlaggedD[UNLAGGEDTICS]; fixed_t restoreD; + // [AK] The old D of the plane before backtracing a player. + fixed_t backtraceRestoreD; + // Returns < 0 : behind; == 0 : on; > 0 : in front int PointOnSide (fixed_t x, fixed_t y, fixed_t z) const { diff -r 06418ca8f939 -r 6c0af85faf2b src/sv_main.cpp --- a/src/sv_main.cpp Fri Nov 19 23:07:16 2021 -0500 +++ b/src/sv_main.cpp Sun Nov 21 10:46:16 2021 -0500 @@ -5858,8 +5858,8 @@ g_aClients[ulClient].lLastServerGametic = moveCmd.ulServerGametic; // [CK] Use the gametic from what we saw // If the client is attacking, he always sends the name of the weapon he's using. - // [AK] Only do this when we're not backtracing this player's movement. - if (( pCmd->ucmd.buttons & BT_ATTACK ) && ( SERVER_IsBacktracingPlayer( ulClient ) == false )) + // [AK] Only do this when we're not extrapolating this player's movement. + if (( pCmd->ucmd.buttons & BT_ATTACK ) && ( SERVER_IsExtrapolatingPlayer( ulClient ) == false )) { // If the name of the weapon the client is using doesn't match the name of the // weapon we think he's using, do something to rectify the situation. @@ -7411,8 +7411,8 @@ // were on the gametic that we started extrapolating this player. for ( int i = 0; i < numsectors; i++ ) { - sectors[i].floorplane.restoreD = sectors[i].floorplane.d; - sectors[i].ceilingplane.restoreD = sectors[i].ceilingplane.d; + sectors[i].floorplane.backtraceRestoreD = sectors[i].floorplane.d; + sectors[i].ceilingplane.backtraceRestoreD = sectors[i].ceilingplane.d; sectors[i].floorplane.d = sectors[i].floorplane.unlaggedD[unlaggedIndex]; sectors[i].ceilingplane.d = sectors[i].ceilingplane.unlaggedD[unlaggedIndex]; @@ -7471,8 +7471,8 @@ // [AK] Restore the sector ceiling/floor heights back to what they were before the backtrace. for ( int i = 0; i < numsectors; i++ ) { - sectors[i].floorplane.d = sectors[i].floorplane.restoreD; - sectors[i].ceilingplane.d = sectors[i].ceilingplane.restoreD; + sectors[i].floorplane.d = sectors[i].floorplane.backtraceRestoreD; + sectors[i].ceilingplane.d = sectors[i].ceilingplane.backtraceRestoreD; } // [AK] As a final measure, fix the player's floorz/ceilingz and to ensure that they don't @@ -7500,8 +7500,8 @@ // [AK] Restore the sector ceiling/floor heights back to what they were before the backtrace. for ( int i = 0; i < numsectors; i++ ) { - sectors[i].floorplane.d = sectors[i].floorplane.restoreD; - sectors[i].ceilingplane.d = sectors[i].ceilingplane.restoreD; + sectors[i].floorplane.d = sectors[i].floorplane.backtraceRestoreD; + sectors[i].ceilingplane.d = sectors[i].ceilingplane.backtraceRestoreD; } oldData.Restore( &players[ulClient] );