- set floor and ceiling sector when it comes from a 3D floor.

There's code in p_mobj.cpp which needs this to pick the correct plane.
This commit is contained in:
Christoph Oelckers 2016-02-19 23:54:55 +01:00
parent 6132f6971a
commit d876a95152
2 changed files with 8 additions and 0 deletions

View file

@ -775,6 +775,7 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li
FTextureID highestfloorpic;
int highestfloorterrain = -1;
FTextureID lowestceilingpic;
sector_t *lowestceilingsec = NULL, *highestfloorsec = NULL;
highestfloorpic.SetInvalid();
lowestceilingpic.SetInvalid();
@ -798,6 +799,7 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li
{
lowestceiling = ff_bottom;
lowestceilingpic = *rover->bottom.texture;
lowestceilingsec = j == 0 ? linedef->frontsector : linedef->backsector;
}
if(ff_top > highestfloor && delta1 < delta2 && (!restrict || thing->Z() >= ff_top))
@ -805,6 +807,7 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li
highestfloor = ff_top;
highestfloorpic = *rover->top.texture;
highestfloorterrain = rover->model->GetTerrain(rover->top.isceiling);
highestfloorsec = j == 0 ? linedef->frontsector : linedef->backsector;
}
if(ff_top > lowestfloor[j] && ff_top <= thing->Z() + thing->MaxStepHeight) lowestfloor[j] = ff_top;
}
@ -815,12 +818,14 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li
open.bottom = highestfloor;
open.floorpic = highestfloorpic;
open.floorterrain = highestfloorterrain;
open.bottomsec = highestfloorsec;
}
if(lowestceiling < open.top)
{
open.top = lowestceiling;
open.ceilingpic = lowestceilingpic;
open.topsec = lowestceilingsec;
}
open.lowfloor = MIN(lowestfloor[0], lowestfloor[1]);

View file

@ -226,6 +226,7 @@ static bool PIT_FindFloorCeiling(FMultiBlockLinesIterator::CheckResult &cres, co
if (open.top < tmf.ceilingz)
{
tmf.ceilingz = open.top;
if (open.topsec != NULL) tmf.floorsector = open.topsec;
}
}
@ -245,7 +246,9 @@ static bool PIT_FindFloorCeiling(FMultiBlockLinesIterator::CheckResult &cres, co
}
if (open.lowfloor < tmf.dropoffz)
{
tmf.dropoffz = open.lowfloor;
}
}
return true;
}