mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 06:53:58 +00:00
- 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:
parent
47e7a30cab
commit
c6fe0835d3
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue