This is a fork of Zandronum Beta for Mac Os (Silicon and Intel)
修订版 | f8baa955611038c5365c73aa10d67af8d7572289 (tree) |
---|---|
时间 | 2022-01-22 02:51:09 |
作者 | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Moved code that disassociates a dead spectator's old body from itself into PLAYER_SetSpectator.
@@ -2661,23 +2661,31 @@ | ||
2661 | 2661 | // at our corpse in case DF2_SAME_SPAWN_SPOT is enabled. |
2662 | 2662 | pPlayer->pCorpse = pOldBody; |
2663 | 2663 | |
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 ) | |
2667 | 2665 | { |
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; | |
2681 | 2689 | } |
2682 | 2690 | } |
2683 | 2691 | // [BB] In case the player is not respawned as dead spectator, we have to manually clear its TID. |
@@ -5871,16 +5871,6 @@ | ||
5871 | 5871 | // [Spleen] Reset reconciliation buffer when player gets spawned |
5872 | 5872 | UNLAGGED_ResetPlayer( p ); |
5873 | 5873 | |
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 | - | |
5884 | 5874 | // [AK] We've spawned now, so we don't need to remember our corpse anymore. |
5885 | 5875 | p->pCorpse = NULL; |
5886 | 5876 |