Commit MetaInfo

Revision80015955de8ef6ffc68fd22bcfb25316649ed04d (tree)
Time2021-11-22 00:46:16
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

- 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.

Change Summary

Incremental Difference

diff -r 06418ca8f939 -r 80015955de8e 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 @@
38623862 }
38633863 }
38643864
3865+ // Cycle psprites
3866+ // [AK] Don't do this while extrapolating the player's movement.
3867+ if ( SERVER_IsExtrapolatingPlayer( player - players ) == false )
3868+ P_MovePsprites (player);
3869+
38653870 // [AK] Stop here if we're backtracing the player's movement.
38663871 if ( SERVER_IsBacktracingPlayer( player - players ))
38673872 return;
38683873
3869- // Cycle psprites
3870- P_MovePsprites (player);
3871-
38723874 // Other Counters
38733875 if (player->damagecount)
38743876 player->damagecount--;
diff -r 06418ca8f939 -r 80015955de8e 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 @@
251251 fixed_t unlaggedD[UNLAGGEDTICS];
252252 fixed_t restoreD;
253253
254+ // [AK] The old D of the plane before backtracing a player.
255+ fixed_t backtraceRestoreD;
256+
254257 // Returns < 0 : behind; == 0 : on; > 0 : in front
255258 int PointOnSide (fixed_t x, fixed_t y, fixed_t z) const
256259 {
diff -r 06418ca8f939 -r 80015955de8e 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 @@
58585858 g_aClients[ulClient].lLastServerGametic = moveCmd.ulServerGametic; // [CK] Use the gametic from what we saw
58595859
58605860 // If the client is attacking, he always sends the name of the weapon he's using.
5861- // [AK] Only do this when we're not backtracing this player's movement.
5862- if (( pCmd->ucmd.buttons & BT_ATTACK ) && ( SERVER_IsBacktracingPlayer( ulClient ) == false ))
5861+ // [AK] Only do this when we're not extrapolating this player's movement.
5862+ if (( pCmd->ucmd.buttons & BT_ATTACK ) && ( SERVER_IsExtrapolatingPlayer( ulClient ) == false ))
58635863 {
58645864 // If the name of the weapon the client is using doesn't match the name of the
58655865 // weapon we think he's using, do something to rectify the situation.
@@ -7411,8 +7411,8 @@
74117411 // were on the gametic that we started extrapolating this player.
74127412 for ( int i = 0; i < numsectors; i++ )
74137413 {
7414- sectors[i].floorplane.restoreD = sectors[i].floorplane.d;
7415- sectors[i].ceilingplane.restoreD = sectors[i].ceilingplane.d;
7414+ sectors[i].floorplane.backtraceRestoreD = sectors[i].floorplane.d;
7415+ sectors[i].ceilingplane.backtraceRestoreD = sectors[i].ceilingplane.d;
74167416
74177417 sectors[i].floorplane.d = sectors[i].floorplane.unlaggedD[unlaggedIndex];
74187418 sectors[i].ceilingplane.d = sectors[i].ceilingplane.unlaggedD[unlaggedIndex];
@@ -7471,8 +7471,8 @@
74717471 // [AK] Restore the sector ceiling/floor heights back to what they were before the backtrace.
74727472 for ( int i = 0; i < numsectors; i++ )
74737473 {
7474- sectors[i].floorplane.d = sectors[i].floorplane.restoreD;
7475- sectors[i].ceilingplane.d = sectors[i].ceilingplane.restoreD;
7474+ sectors[i].floorplane.d = sectors[i].floorplane.backtraceRestoreD;
7475+ sectors[i].ceilingplane.d = sectors[i].ceilingplane.backtraceRestoreD;
74767476 }
74777477
74787478 // [AK] As a final measure, fix the player's floorz/ceilingz and to ensure that they don't
@@ -7500,8 +7500,8 @@
75007500 // [AK] Restore the sector ceiling/floor heights back to what they were before the backtrace.
75017501 for ( int i = 0; i < numsectors; i++ )
75027502 {
7503- sectors[i].floorplane.d = sectors[i].floorplane.restoreD;
7504- sectors[i].ceilingplane.d = sectors[i].ceilingplane.restoreD;
7503+ sectors[i].floorplane.d = sectors[i].floorplane.backtraceRestoreD;
7504+ sectors[i].ceilingplane.d = sectors[i].ceilingplane.backtraceRestoreD;
75057505 }
75067506
75077507 oldData.Restore( &players[ulClient] );
Show on old repository browser