From 22f5c69b4cdb6064181da76081806cdf28775491 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 29 Dec 2022 22:45:36 +1100 Subject: [PATCH] - Duke: Fix bad `checkaccessswitch_*()` calls. * Fixes #815. --- source/games/duke/src/sectors_d.cpp | 3 ++- source/games/duke/src/sectors_r.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index 55056e80d..e6600d0ed 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -246,7 +246,8 @@ bool checkhitswitch_d(int snum, walltype* wwal, DDukeActor *act) break; case DTILE_ACCESSSWITCH: case DTILE_ACCESSSWITCH2: - checkaccessswitch_d(snum, switchpal, act, wwal); + if (checkaccessswitch_d(snum, switchpal, act, wwal)) + return 0; [[fallthrough]]; case DTILE_DIPSWITCH2: case DTILE_DIPSWITCH2ON: diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index b8897f924..db15da38b 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -216,7 +216,8 @@ bool checkhitswitch_r(int snum, walltype* wwal, DDukeActor* act) break; case RTILE_ACCESSSWITCH: case RTILE_ACCESSSWITCH2: - checkaccessswitch_r(snum, switchpal, act, wwal); + if (checkaccessswitch_r(snum, switchpal, act, wwal)) + return 0; goto goOn1; case RTILE_MULTISWITCH2: