Move MobjLineCollide up a bit to where we first know for sure that we hit a line

This commit is contained in:
Nami 2020-01-01 19:38:48 -08:00
parent ef4840555e
commit ad610ba4aa
1 changed files with 14 additions and 12 deletions

View File

@ -1943,6 +1943,19 @@ static boolean PIT_CheckLine(line_t *ld)
// this line is out of the if so upper and lower textures can be hit by a splat
blockingline = ld;
#ifdef HAVE_BLUA
{
UINT8 shouldCollide = LUAh_MobjLineCollide(tmthing, blockingline); // checks hook for thing's type
if (P_MobjWasRemoved(tmthing))
return true; // one of them was removed???
if (shouldCollide == 1)
return false; // force collide
else if (shouldCollide == 2)
return true; // force no collide
}
#endif
if (!ld->backsector) // one sided line
{
if (P_PointOnLineSide(tmthing->x, tmthing->y, ld))
@ -1987,18 +2000,7 @@ static boolean PIT_CheckLine(line_t *ld)
if (lowfloor < tmdropoffz)
tmdropoffz = lowfloor;
#ifdef HAVE_BLUA
{
UINT8 shouldCollide = LUAh_MobjLineCollide(tmthing, ld); // checks hook for thing's type
if (P_MobjWasRemoved(tmthing))
return true; // one of them was removed???
if (shouldCollide == 1)
return false; // force collide
else if (shouldCollide == 2)
return true; // force no collide
}
#endif
return true;
}