- fixed some issues with P_FindFloorCeiling rework.

This commit is contained in:
Christoph Oelckers 2016-02-19 19:14:49 +01:00
parent 28799c4b51
commit cb0e7c6ca5
3 changed files with 10 additions and 0 deletions

View file

@ -857,6 +857,8 @@ bool PIT_CheckLine(line_t *ld, const FBoundingBox &box, FCheckPosition &tm)
fixedvec2 ref = FindRefPoint(ld, rpos); fixedvec2 ref = FindRefPoint(ld, rpos);
FLineOpening open; FLineOpening open;
P_LineOpening(open, tm.thing, ld, ref.x, ref.y, tm.x, tm.y, 0);
// the floorplane on both sides is identical with the current one // the floorplane on both sides is identical with the current one
// so don't mess around with the z-position. // so don't mess around with the z-position.
if (ld->frontsector->floorplane == ld->backsector->floorplane && if (ld->frontsector->floorplane == ld->backsector->floorplane &&

View file

@ -918,6 +918,8 @@ void P_CreateLinkedPortals()
} }
if (orgs.Size() == 0) if (orgs.Size() == 0)
{ {
// Create the 0->0 translation which is always needed.
Displacements.Create(1);
return; return;
} }
for (int i = 0; i < numsectors; i++) for (int i = 0; i < numsectors; i++)

View file

@ -41,6 +41,11 @@ struct FDisplacementTable
TArray<FDisplacement> data; TArray<FDisplacement> data;
int size; int size;
FDisplacementTable()
{
Create(1);
}
void Create(int numgroups) void Create(int numgroups)
{ {
data.Resize(numgroups*numgroups); data.Resize(numgroups*numgroups);
@ -50,6 +55,7 @@ struct FDisplacementTable
FDisplacement &operator()(int x, int y) FDisplacement &operator()(int x, int y)
{ {
if (x == y) return data[0]; // shortcut for the most common case
return data[x + size*y]; return data[x + size*y];
} }
}; };