mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- fixed: When finding the highest floor plane on a given side of a linedef, the necessary tests may not depend on the actual highest floor, which may originate from the other side of the line and cause valid planes that are between the currently set plane and the actual highest floor to be skipped.
This commit is contained in:
parent
d8b8767ee9
commit
67f6f28b55
2 changed files with 25 additions and 19 deletions
|
@ -1283,7 +1283,7 @@ DMenuItemBase * CreateOptionMenuItemSubmenu(const char *label, FName cmd, int ce
|
|||
|
||||
DMenuItemBase * CreateOptionMenuItemControl(const char *label, FName cmd, FKeyBindings *bindings)
|
||||
{
|
||||
auto c = PClass::FindClass("OptionMenuItemControl");
|
||||
auto c = PClass::FindClass("OptionMenuItemControlBase");
|
||||
auto p = c->CreateNew();
|
||||
VMValue params[] = { p, FString(label), cmd.GetIndex(), bindings };
|
||||
auto f = dyn_cast<PFunction>(c->Symbols.FindSymbol("Init", false));
|
||||
|
|
|
@ -773,7 +773,7 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li
|
|||
int highestfloorterrain = -1;
|
||||
FTextureID lowestceilingpic;
|
||||
sector_t *lowestceilingsec = NULL, *highestfloorsec = NULL;
|
||||
secplane_t *highestfloorplanes[2] = { NULL, NULL };
|
||||
secplane_t *highestfloorplanes[2] = { &open.frontfloorplane, &open.backfloorplane };
|
||||
|
||||
highestfloorpic.SetInvalid();
|
||||
lowestceilingpic.SetInvalid();
|
||||
|
@ -800,13 +800,19 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li
|
|||
lowestceilingsec = j == 0 ? linedef->frontsector : linedef->backsector;
|
||||
}
|
||||
|
||||
if(ff_top > highestfloor && delta1 <= delta2 && (!restrict || thing->Z() >= ff_top))
|
||||
if(delta1 <= delta2 && (!restrict || thing->Z() >= ff_top))
|
||||
{
|
||||
highestfloor = ff_top;
|
||||
highestfloorpic = *rover->top.texture;
|
||||
highestfloorterrain = rover->model->GetTerrain(rover->top.isceiling);
|
||||
highestfloorsec = j == 0 ? linedef->frontsector : linedef->backsector;
|
||||
highestfloorplanes[j] = rover->top.plane;
|
||||
if (ff_top > highestfloor)
|
||||
{
|
||||
highestfloor = ff_top;
|
||||
highestfloorpic = *rover->top.texture;
|
||||
highestfloorterrain = rover->model->GetTerrain(rover->top.isceiling);
|
||||
highestfloorsec = j == 0 ? linedef->frontsector : linedef->backsector;
|
||||
}
|
||||
if (ff_top > highestfloorplanes[j]->ZatPoint(x, y))
|
||||
{
|
||||
highestfloorplanes[j] = rover->top.plane;
|
||||
}
|
||||
}
|
||||
if(ff_top > lowestfloor[j] && ff_top <= thing->Z() + thing->MaxStepHeight) lowestfloor[j] = ff_top;
|
||||
}
|
||||
|
@ -818,18 +824,18 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li
|
|||
open.floorpic = highestfloorpic;
|
||||
open.floorterrain = highestfloorterrain;
|
||||
open.bottomsec = highestfloorsec;
|
||||
if (highestfloorplanes[0])
|
||||
{
|
||||
open.frontfloorplane = *highestfloorplanes[0];
|
||||
if (open.frontfloorplane.fC() < 0) open.frontfloorplane.FlipVert();
|
||||
}
|
||||
if (highestfloorplanes[1])
|
||||
{
|
||||
open.backfloorplane = *highestfloorplanes[1];
|
||||
if (open.backfloorplane.fC() < 0) open.backfloorplane.FlipVert();
|
||||
}
|
||||
}
|
||||
|
||||
if (highestfloorplanes[0] != &open.frontfloorplane)
|
||||
{
|
||||
open.frontfloorplane = *highestfloorplanes[0];
|
||||
if (open.frontfloorplane.fC() < 0) open.frontfloorplane.FlipVert();
|
||||
}
|
||||
if (highestfloorplanes[1] != &open.backfloorplane)
|
||||
{
|
||||
open.backfloorplane = *highestfloorplanes[1];
|
||||
if (open.backfloorplane.fC() < 0) open.backfloorplane.FlipVert();
|
||||
}
|
||||
|
||||
if(lowestceiling < open.top)
|
||||
{
|
||||
open.top = lowestceiling;
|
||||
|
|
Loading…
Reference in a new issue