• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-c誰得cocoaqtpythonrubywindowsphpgameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwitterdombtronvb.nettestarduinodirectxpreviewerゲームエンジン

This is a fork of Zandronum Beta for TSPG.


Commit MetaInfo

Revisionbab1ee78ac78f6035bc779b347beb37b2209495e (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 fb87f3720612 -r bab1ee78ac78 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 fb87f3720612 -r bab1ee78ac78 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 fb87f3720612 -r bab1ee78ac78 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
@@ -5964,8 +5964,8 @@
59645964 g_aClients[ulClient].lLastServerGametic = moveCmd.ulServerGametic; // [CK] Use the gametic from what we saw
59655965
59665966 // If the client is attacking, he always sends the name of the weapon he's using.
5967- // [AK] Only do this when we're not backtracing this player's movement.
5968- if (( pCmd->ucmd.buttons & BT_ATTACK ) && ( SERVER_IsBacktracingPlayer( ulClient ) == false ))
5967+ // [AK] Only do this when we're not extrapolating this player's movement.
5968+ if (( pCmd->ucmd.buttons & BT_ATTACK ) && ( SERVER_IsExtrapolatingPlayer( ulClient ) == false ))
59695969 {
59705970 // If the name of the weapon the client is using doesn't match the name of the
59715971 // weapon we think he's using, do something to rectify the situation.
@@ -7518,8 +7518,8 @@
75187518 // were on the gametic that we started extrapolating this player.
75197519 for ( int i = 0; i < numsectors; i++ )
75207520 {
7521- sectors[i].floorplane.restoreD = sectors[i].floorplane.d;
7522- sectors[i].ceilingplane.restoreD = sectors[i].ceilingplane.d;
7521+ sectors[i].floorplane.backtraceRestoreD = sectors[i].floorplane.d;
7522+ sectors[i].ceilingplane.backtraceRestoreD = sectors[i].ceilingplane.d;
75237523
75247524 sectors[i].floorplane.d = sectors[i].floorplane.unlaggedD[unlaggedIndex];
75257525 sectors[i].ceilingplane.d = sectors[i].ceilingplane.unlaggedD[unlaggedIndex];
@@ -7578,8 +7578,8 @@
75787578 // [AK] Restore the sector ceiling/floor heights back to what they were before the backtrace.
75797579 for ( int i = 0; i < numsectors; i++ )
75807580 {
7581- sectors[i].floorplane.d = sectors[i].floorplane.restoreD;
7582- sectors[i].ceilingplane.d = sectors[i].ceilingplane.restoreD;
7581+ sectors[i].floorplane.d = sectors[i].floorplane.backtraceRestoreD;
7582+ sectors[i].ceilingplane.d = sectors[i].ceilingplane.backtraceRestoreD;
75837583 }
75847584
75857585 // [AK] As a final measure, fix the player's floorz/ceilingz and to ensure that they don't
@@ -7607,8 +7607,8 @@
76077607 // [AK] Restore the sector ceiling/floor heights back to what they were before the backtrace.
76087608 for ( int i = 0; i < numsectors; i++ )
76097609 {
7610- sectors[i].floorplane.d = sectors[i].floorplane.restoreD;
7611- sectors[i].ceilingplane.d = sectors[i].ceilingplane.restoreD;
7610+ sectors[i].floorplane.d = sectors[i].floorplane.backtraceRestoreD;
7611+ sectors[i].ceilingplane.d = sectors[i].ceilingplane.backtraceRestoreD;
76127612 }
76137613
76147614 oldData.Restore( &players[ulClient] );