- Fixed: the dropoff detection code needs to be aware of extra floors.

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@882 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
gez 2010-08-11 18:26:12 +00:00
parent f474931ea8
commit ab92845b8b

View file

@ -655,8 +655,34 @@ bool PIT_CheckLine (line_t *ld, const FBoundingBox &box, FCheckPosition &tm)
if (!(tm.thing->flags & MF_DROPOFF) &&
!(tm.thing->flags & (MF_NOGRAVITY|MF_NOCLIP)))
{
if (ld->frontsector->floorplane.c < STEEPSLOPE ||
ld->backsector->floorplane.c < STEEPSLOPE)
secplane_t *frontplane = &ld->frontsector->floorplane;
secplane_t *backplane = &ld->backsector->floorplane;
#ifdef _3DFLOORS
// Check 3D floors as well
static secplane_t copyplane;
sector_t *floorsector = NULL;
secplane_t **changeplane = NULL;
for (floorsector = ld->frontsector, changeplane = &frontplane;
floorsector != ld->backsector;
floorsector = ld->backsector, changeplane = &backplane)
{
if (floorsector->e) // apparently this can be called when the data is already gone-
for(unsigned int i=0;i<floorsector->e->XFloor.ffloors.Size();i++)
{
F3DFloor * rover= floorsector->e->XFloor.ffloors[i];
if(!(rover->flags & FF_SOLID) || !(rover->flags & FF_EXISTS)) continue;
if (rover->top.plane->ZatPoint(tm.thing->x, tm.thing->y) == tm.thing->floorz)
{
copyplane = *rover->top.plane;
if (copyplane.c<0) copyplane.FlipVert();
*changeplane = &copyplane;
break;
}
}
}
#endif
if (frontplane->c < STEEPSLOPE || backplane->c < STEEPSLOPE)
{
const msecnode_t *node = tm.thing->touching_sectorlist;
bool allow = false;