From c6fe0835d3fdba2509403c82d9c21dfa78a4c5cd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 27 Apr 2015 20:37:01 +0200 Subject: [PATCH] - fixed: The check for unblocking overlapping actors was a bit too lax. The code never checked the starting position of the move and could be erroneously triggered in rare situations where the distance increased between actors but the hit boxes started overlapping because x or y distance got below the radius. Changed it so that the code only gets executed when there's already an overlap before the move. --- src/p_map.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index 6370fa849..3d878c1f1 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -1034,7 +1034,7 @@ bool PIT_CheckThing(AActor *thing, FCheckPosition &tm) // Both things overlap in x or y direction bool unblocking = false; - if (tm.FromPMove || tm.thing->player != NULL) + if ((tm.FromPMove || tm.thing->player != NULL) && thing->flags&MF_SOLID) { // Both actors already overlap. To prevent them from remaining stuck allow the move if it // takes them further apart or the move does not change the position (when called from P_ChangeSector.) @@ -1042,7 +1042,9 @@ bool PIT_CheckThing(AActor *thing, FCheckPosition &tm) { unblocking = true; } - else + else if (abs(thing->x - tm.thing->x) < (thing->radius+tm.thing->radius)/2 && + abs(thing->y - tm.thing->y) < (thing->radius+tm.thing->radius)/2) + { fixed_t newdist = P_AproxDistance(thing->x - tm.x, thing->y - tm.y); fixed_t olddist = P_AproxDistance(thing->x - tm.thing->x, thing->y - tm.thing->y);