From e86de4463f8d938ac15d099854e7fdfe9f51ad71 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 16 Sep 2023 21:05:44 +0200 Subject: [PATCH] fixed CheckswitchRange logic for multiple switches on a line. --- src/playsim/p_switch.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/playsim/p_switch.cpp b/src/playsim/p_switch.cpp index 9daf8cf9d4..e89f030114 100644 --- a/src/playsim/p_switch.cpp +++ b/src/playsim/p_switch.cpp @@ -195,9 +195,12 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno, const DVector3 * } } - return (user->Level->i_compatflags2 & COMPATF2_CHECKSWITCHRANGE) + if ((user->Level->i_compatflags2 & COMPATF2_CHECKSWITCHRANGE) ? (user->Top() >= open.top) - : (user->Top() > open.top); + : (user->Top() > open.top)) + { + return true; + } } if ((TexAnim.FindSwitch(side->GetTexture(side_t::bottom))) != NULL) { @@ -219,9 +222,12 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno, const DVector3 * } } - return (user->Level->i_compatflags2 & COMPATF2_CHECKSWITCHRANGE) + if ((user->Level->i_compatflags2 & COMPATF2_CHECKSWITCHRANGE) ? (user->Z() <= open.bottom) - : (user->Z() < open.bottom); + : (user->Z() < open.bottom)) + { + return true; + } } if ((flags & ML_3DMIDTEX) || (TexAnim.FindSwitch(side->GetTexture(side_t::mid))) != NULL) {