From 3b2126ba951be310d9cdef2a6053a5d2a314784b Mon Sep 17 00:00:00 2001 From: "Eevee (Alex Munroe)" Date: Tue, 9 Jun 2015 13:20:10 -0700 Subject: [PATCH 1/2] Don't allow pressing a checkswitchrange switch that's in the floor. --- src/p_switch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_switch.cpp b/src/p_switch.cpp index 5aeff7b46..6ea04593f 100644 --- a/src/p_switch.cpp +++ b/src/p_switch.cpp @@ -181,7 +181,7 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno) } else if ((TexMan.FindSwitch(side->GetTexture(side_t::bottom))) != NULL) { - return (user->z <= open.bottom); + return (user->z < open.bottom); } else if ((flags & ML_3DMIDTEX) || (TexMan.FindSwitch(side->GetTexture(side_t::mid))) != NULL) { @@ -194,7 +194,7 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno) else { // no switch found. Check whether the player can touch either top or bottom texture - return (user->z + user->height >= open.top) || (user->z <= open.bottom); + return (user->z + user->height >= open.top) || (user->z < open.bottom); } } From 911b35370e28af78002cd28268a24e793895ede8 Mon Sep 17 00:00:00 2001 From: "Eevee (Alex Munroe)" Date: Tue, 9 Jun 2015 13:41:48 -0700 Subject: [PATCH 2/2] Let's go wild and do it for the ceiling, too. --- src/p_switch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_switch.cpp b/src/p_switch.cpp index 6ea04593f..1ca4654b5 100644 --- a/src/p_switch.cpp +++ b/src/p_switch.cpp @@ -177,7 +177,7 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno) if ((TexMan.FindSwitch(side->GetTexture(side_t::top))) != NULL) { - return (user->z + user->height >= open.top); + return (user->z + user->height > open.top); } else if ((TexMan.FindSwitch(side->GetTexture(side_t::bottom))) != NULL) { @@ -194,7 +194,7 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno) else { // no switch found. Check whether the player can touch either top or bottom texture - return (user->z + user->height >= open.top) || (user->z < open.bottom); + return (user->z + user->height > open.top) || (user->z < open.bottom); } }