From 31bb7d33483a68c5b7850657b490159f1fe8c45a Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Fri, 6 Oct 2023 15:16:02 +1100 Subject: [PATCH] - Duke: Repair crash when calling `OnEvent(EVENT_ENTERLEVEL)`. --- source/games/duke/src/premap.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 0d9ea2db9..8166ff309 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -1133,7 +1133,10 @@ void enterlevel(MapRecord *mi, int gamemode) ud.ffire = ud.m_ffire; lastlevel = 0; - OnEvent(EVENT_ENTERLEVEL); + for (int i = connecthead; i >= 0; i = connectpoint2[i]) + { + OnEvent(EVENT_ENTERLEVEL, i); + } // Stop all sounds FX_StopAllSounds();