• R/O
  • SSH

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

This is a fork of Zandronum Beta for Mac Os (Silicon and Intel)


Commit MetaInfo

修订版f8baa955611038c5365c73aa10d67af8d7572289 (tree)
时间2022-01-22 02:51:09
作者Adam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Moved code that disassociates a dead spectator's old body from itself into PLAYER_SetSpectator.

更改概述

差异

diff -r 2ea5ba700303 -r f8baa9556110 src/p_interaction.cpp
--- a/src/p_interaction.cpp Fri Jan 21 00:34:36 2022 -0500
+++ b/src/p_interaction.cpp Fri Jan 21 12:51:09 2022 -0500
@@ -2661,23 +2661,31 @@
26612661 // at our corpse in case DF2_SAME_SPAWN_SPOT is enabled.
26622662 pPlayer->pCorpse = pOldBody;
26632663
2664- // Set the player's new body to the position of his or her old body.
2665- if (( pPlayer->mo ) &&
2666- ( pOldBody ))
2664+ if ( pOldBody )
26672665 {
2668- // [BB] It's possible that the old body is at a place that's inaccessible to spectators
2669- // (whatever source killed the player possibly moved the body after the player's death).
2670- // If that's the case, don't move the spectator to the old body position, but to the place
2671- // where G_DoReborn spawned him.
2672- fixed_t playerSpawnX = pPlayer->mo->x;
2673- fixed_t playerSpawnY = pPlayer->mo->y;
2674- fixed_t playerSpawnZ = pPlayer->mo->z;
2675- pPlayer->mo->SetOrigin( pOldBody->x, pOldBody->y, pOldBody->z );
2676- if ( P_TestMobjLocation ( pPlayer->mo ) == false )
2677- pPlayer->mo->SetOrigin( playerSpawnX, playerSpawnY, playerSpawnZ );
2678-
2679- if ( NETWORK_GetState( ) == NETSTATE_SERVER )
2680- SERVERCOMMANDS_MoveLocalPlayer( ULONG( pPlayer - players ));
2666+ // Set the player's new body to the position of his or her old body.
2667+ if ( pPlayer->mo )
2668+ {
2669+ // [BB] It's possible that the old body is at a place that's inaccessible to spectators
2670+ // (whatever source killed the player possibly moved the body after the player's death).
2671+ // If that's the case, don't move the spectator to the old body position, but to the place
2672+ // where G_DoReborn spawned him.
2673+ fixed_t playerSpawnX = pPlayer->mo->x;
2674+ fixed_t playerSpawnY = pPlayer->mo->y;
2675+ fixed_t playerSpawnZ = pPlayer->mo->z;
2676+ pPlayer->mo->SetOrigin( pOldBody->x, pOldBody->y, pOldBody->z );
2677+ if ( P_TestMobjLocation ( pPlayer->mo ) == false )
2678+ pPlayer->mo->SetOrigin( playerSpawnX, playerSpawnY, playerSpawnZ );
2679+
2680+ if ( NETWORK_GetState( ) == NETSTATE_SERVER )
2681+ SERVERCOMMANDS_MoveLocalPlayer( ULONG( pPlayer - players ));
2682+ }
2683+
2684+ // [AK] Disassociate the player from their old body. This prevents the old body from
2685+ // being frozen and not finishing their animation when they become a spectator.
2686+ // Add their old body to body queue too.
2687+ G_QueueBody( pOldBody );
2688+ pOldBody->player = NULL;
26812689 }
26822690 }
26832691 // [BB] In case the player is not respawned as dead spectator, we have to manually clear its TID.
diff -r 2ea5ba700303 -r f8baa9556110 src/p_mobj.cpp
--- a/src/p_mobj.cpp Fri Jan 21 00:34:36 2022 -0500
+++ b/src/p_mobj.cpp Fri Jan 21 12:51:09 2022 -0500
@@ -5871,16 +5871,6 @@
58715871 // [Spleen] Reset reconciliation buffer when player gets spawned
58725872 UNLAGGED_ResetPlayer( p );
58735873
5874- // [AK] If the player is supposed to be a dead spectator, disassociate them
5875- // from the old body. This prevents the old body from being frozen and not
5876- // finishing their animation when they become a spectator.
5877- // Add their old body to body queue too.
5878- if (( p->bDeadSpectator ) && ( oldactor != NULL ) && ( oldactor->player == p ))
5879- {
5880- G_QueueBody( oldactor );
5881- oldactor->player = NULL;
5882- }
5883-
58845874 // [AK] We've spawned now, so we don't need to remember our corpse anymore.
58855875 p->pCorpse = NULL;
58865876