- 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:
Christoph Oelckers 2017-02-15 13:14:59 +01:00
parent d8b8767ee9
commit 67f6f28b55
2 changed files with 25 additions and 19 deletions

View file

@ -1283,7 +1283,7 @@ DMenuItemBase * CreateOptionMenuItemSubmenu(const char *label, FName cmd, int ce
DMenuItemBase * CreateOptionMenuItemControl(const char *label, FName cmd, FKeyBindings *bindings) DMenuItemBase * CreateOptionMenuItemControl(const char *label, FName cmd, FKeyBindings *bindings)
{ {
auto c = PClass::FindClass("OptionMenuItemControl"); auto c = PClass::FindClass("OptionMenuItemControlBase");
auto p = c->CreateNew(); auto p = c->CreateNew();
VMValue params[] = { p, FString(label), cmd.GetIndex(), bindings }; VMValue params[] = { p, FString(label), cmd.GetIndex(), bindings };
auto f = dyn_cast<PFunction>(c->Symbols.FindSymbol("Init", false)); auto f = dyn_cast<PFunction>(c->Symbols.FindSymbol("Init", false));

View file

@ -773,7 +773,7 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li
int highestfloorterrain = -1; int highestfloorterrain = -1;
FTextureID lowestceilingpic; FTextureID lowestceilingpic;
sector_t *lowestceilingsec = NULL, *highestfloorsec = NULL; sector_t *lowestceilingsec = NULL, *highestfloorsec = NULL;
secplane_t *highestfloorplanes[2] = { NULL, NULL }; secplane_t *highestfloorplanes[2] = { &open.frontfloorplane, &open.backfloorplane };
highestfloorpic.SetInvalid(); highestfloorpic.SetInvalid();
lowestceilingpic.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; 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; if (ff_top > highestfloor)
highestfloorpic = *rover->top.texture; {
highestfloorterrain = rover->model->GetTerrain(rover->top.isceiling); highestfloor = ff_top;
highestfloorsec = j == 0 ? linedef->frontsector : linedef->backsector; highestfloorpic = *rover->top.texture;
highestfloorplanes[j] = rover->top.plane; 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; 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.floorpic = highestfloorpic;
open.floorterrain = highestfloorterrain; open.floorterrain = highestfloorterrain;
open.bottomsec = highestfloorsec; 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) if(lowestceiling < open.top)
{ {
open.top = lowestceiling; open.top = lowestceiling;