# HG changeset patch # User Adam Kaminski # Date 1627014696 14400 # Fri Jul 23 00:31:36 2021 -0400 # Node ID bdf6f143e7e48cf7ca28a522b78b6c2b5f678acb # Parent 07e3fba9b812e8d27a3acff5339984ac2d8b4c6c Don't respawn players where they died if their corpses are partially inside a crushing sector. diff -r 07e3fba9b812 -r bdf6f143e7e4 src/p_interaction.cpp --- a/src/p_interaction.cpp Thu Jul 22 20:08:58 2021 -0400 +++ b/src/p_interaction.cpp Fri Jul 23 00:31:36 2021 -0400 @@ -3367,8 +3367,15 @@ // through all ceilings crushers and see if one is connected to the sector the player's body is in. while (( pCeiling = CeilingIterator.Next( )) != NULL ) { - if (( pCeiling->GetSector( ) == mo->Sector ) && ( pCeiling->GetCrush( ) > -1 )) - return false; + if ( pCeiling->GetCrush( ) <= 0 ) + continue; + + // [AK] Don't respawn the player where they died if their body is partially inside a crusher. + for ( msecnode_t *snode = mo->touching_sectorlist; snode; snode = snode->m_snext ) + { + if ( snode->m_sector == pCeiling->GetSector( )) + return false; + } } DFloor *pFloor; @@ -3377,8 +3384,15 @@ // [AK] Next, check all the floor crushers. while (( pFloor = FloorIterator.Next( )) != NULL ) { - if (( pFloor->GetSector( ) == mo->Sector ) && ( pFloor->GetCrush( ) > -1 )) - return false; + if ( pFloor->GetCrush( ) <= 0 ) + continue; + + // [AK] Don't respawn the player where they died if their body is partially inside a crusher. + for ( msecnode_t *snode = mo->touching_sectorlist; snode; snode = snode->m_snext ) + { + if ( snode->m_sector == pFloor->GetSector( )) + return false; + } } return true;