From 3b818171d5f1796c0c1ff2acc0f06a233900324e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 5 Jun 2017 12:20:59 +0200 Subject: [PATCH] - do not let P_AdjustFloorCeil use the return from P_CheckPosition if floorz is greater than ceilingz. This can only happen if some thing gets placed somewhere it doesn't physically fit in and as a result of the floor move would be pushed into an even more invalid place. See https://forum.zdoom.org/viewtopic.php?f=2&t=56764 --- src/p_map.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index 66becf1fe..0aa3b58ad 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -5884,7 +5884,10 @@ bool P_AdjustFloorCeil(AActor *thing, FChangePosition *cpos) } bool isgood = P_CheckPosition(thing, thing->Pos(), tm); - if (!(thing->flags4 & MF4_ACTLIKEBRIDGE)) + + // This is essentially utterly broken because it even uses the return from a failed P_CheckPosition but the entire logic will break down if that isn't done. + // However, if tm.floorz is greater than tm.ceilingz we have a real problem that needs to be dealt with exolicitly. + if (!(thing->flags4 & MF4_ACTLIKEBRIDGE) && tm.floorz <= tm.ceilingz) { thing->floorz = tm.floorz; thing->ceilingz = tm.ceilingz;