From 8c8487231a8edd4f6cd14e006914c7ab49eb4c7b Mon Sep 17 00:00:00 2001 From: smallmodel <15067410+smallmodel@users.noreply.github.com> Date: Wed, 27 Sep 2023 23:55:27 +0200 Subject: [PATCH] Fixed P_DeleteViewModel when the viewmodel is NULL --- code/fgame/weapturret.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/fgame/weapturret.cpp b/code/fgame/weapturret.cpp index 00349f771..60eb58e88 100644 --- a/code/fgame/weapturret.cpp +++ b/code/fgame/weapturret.cpp @@ -1730,6 +1730,10 @@ void TurretGun::P_CreateViewModel(void) void TurretGun::P_DeleteViewModel(void) { + if (!m_pViewModel) { + return; + } + m_pViewModel->Delete(); m_pViewModel = NULL;