Fixed: a skin's death sound didn't get used if the player respawned before the death sound could play on the corpse.
This addresses this ticket on the tracker: https://zandronum.com/tracker/view.php?id=4160
Typically, a player might respawn before their body plays their death sound via A_PlayerScream
or A_XScream
if compat_instantrespawn
is enabled. However, when they respawn their corpse is no longer associated with them. Without that connection, it can't use the death sounds of the player's skin when needed and will use the default death/gibbed sounds instead.
To fix this, I added a new member: player_t *APlayerPawn::oldPlayer
that's assigned to the player that the corpse belonged to when they respawn. To minimize delta from (G)ZDoom code in A_PlayerScream
and A_XScream
, self->player
(if null) is temporarily changed to oldPlayer
, just enough so the skin's death sound gets played instead.