From 94341e85827016fa24ea194b370b30736837dc0c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 6 Nov 2020 20:13:06 +0100 Subject: [PATCH] - fixed missing null check in SetOwner and SetHitOwner. --- source/games/duke/src/types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index 1a7dad66d..04a610d25 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -60,7 +60,7 @@ struct weaponhit inline void SetOwner(weaponhit* a) { - s.owner = a->GetIndex(); + s.owner = a? a->GetIndex() : -1; } // same for the 'hittype' owner - which is normally the shooter in an attack. @@ -71,7 +71,7 @@ struct weaponhit inline void SetHitOwner(weaponhit* a) { - owner = a->GetIndex(); + owner = a ? a->GetIndex() : -1; } // This used the Owner field - better move this to something more safe.