From d876a95152f3d9f806a7bcb477fa62d246b2888e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 19 Feb 2016 23:54:55 +0100 Subject: [PATCH] - 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. --- src/p_3dfloors.cpp | 5 +++++ src/p_map.cpp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/p_3dfloors.cpp b/src/p_3dfloors.cpp index 61c4564b91..397d2be1e7 100644 --- a/src/p_3dfloors.cpp +++ b/src/p_3dfloors.cpp @@ -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]); diff --git a/src/p_map.cpp b/src/p_map.cpp index 1bfd280f30..f357253afe 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -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; }