- 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.
This commit is contained in:
Christoph Oelckers 2015-04-27 20:37:01 +02:00
parent 47e7a30cab
commit c6fe0835d3

View file

@ -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);