From 3712a2cea5ca1fcc2388a9cf83438422520ffbd3 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 5 Jun 2018 11:06:31 +0300 Subject: [PATCH] - fix crash on dying when player class has no death states https://forum.zdoom.org/viewtopic.php?t=60815 (cherry picked from commit 7009755c52e14a8d317611218eb42a3b05180db9) --- src/p_interaction.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 730cf8b34..05921b6f8 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -719,7 +719,9 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags) tics = 1; } } - else + // The following condition is needed to avoid crash when player class has no death states + // Instance of player pawn will be garbage collected on reloading of level + else if (player == nullptr) { Destroy(); }