# HG changeset patch # User Adam Kaminski # Date 1642355076 18000 # Sun Jan 16 12:44:36 2022 -0500 # Node ID b4ee3c02480aa94f3917150c7f2a1786d744b801 # Parent 0d1ddc1e93a5a1cd0c2c004f46b063747ca0b168 Fixed: spectating a morphed player could potentially crash the game. diff -r 0d1ddc1e93a5 -r b4ee3c02480a src/p_interaction.cpp --- a/src/p_interaction.cpp Sun Jan 16 15:27:12 2022 -0500 +++ b/src/p_interaction.cpp Sun Jan 16 12:44:36 2022 -0500 @@ -2528,13 +2528,13 @@ return; } - // [AK] If this player's current mobj doesn't match their player class due to - // A_SkullPop, then we must reset their mobj back to the original body. + // [AK] If this player's current mobj derives from APlayerChunk due to A_SkullPop + // then we must reset their mobj back to the original body. else if (( bDeadSpectator == false ) && ( pPlayer->mo != NULL ) && ( pPlayer->cls != NULL )) { APlayerPawn *mo = pPlayer->mo; - if (( mo->GetClass()->TypeName != pPlayer->cls->TypeName ) && ( mo->target != NULL )) + if (( mo->IsKindOf( RUNTIME_CLASS( APlayerChunk ))) && ( mo->target != NULL )) { APlayerPawn *pmo = barrier_cast( pPlayer->mo->target ); mo->player = NULL;