From ed6eecaf0b5c15eb3a375d9b5bd3583b16650317 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 29 Jan 2023 19:18:01 +0000 Subject: [PATCH] Fix crash in Shadow Warrior when player dies --- source/games/sw/src/sounds.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/games/sw/src/sounds.cpp b/source/games/sw/src/sounds.cpp index 2f2f621d8..1df53bb98 100644 --- a/source/games/sw/src/sounds.cpp +++ b/source/games/sw/src/sounds.cpp @@ -537,7 +537,8 @@ void SWSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], { auto act = ((PLAYER*)source)->actor; if (act) vPos = act->getPosWithOffsetZ(); - else vPos = pp->actor->getPosWithOffsetZ(); + else if (pp->actor) + vPos = pp->actor->getPosWithOffsetZ(); } pancheck = true; FVector3 npos = GetSoundPos(vPos);