From a8212f0756ac13f71e22edc932669896537bf981 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 4 Nov 2020 20:25:02 +0100 Subject: [PATCH] - crash fix in spawn and camera fix. --- source/games/duke/src/sectors_d.cpp | 2 +- source/games/duke/src/spawn_d.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index 7265b7f9d..a2256d407 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -1720,7 +1720,7 @@ void checksectors_d(int snum) p->cursectnum = j; // parallaxtype = 2; - p->newowner = i; + p->newowner = acti->GetIndex(); return; } } diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index 73a31a414..37c201d25 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -50,8 +50,8 @@ int spawn_d(int j, int pn) i &= 0xffffff; auto act = &hittype[i]; auto sp = &act->s; - auto actj = &hittype[j]; - auto spj = &actj->s; + auto actj = j == -1 ? nullptr : &hittype[j]; + auto spj = j == -1 ? nullptr : &actj->s; auto t = act->temp_data; int sect = sp->sectnum;