- Fixed: The onlyspawnpos handling in P_FindFloorCeiling would fail to adjust an actor's floorz
(and related) to a 3D midtex beneath its Z if it also touched a 3D midtex above its Z. SVN r3548 (trunk)
This commit is contained in:
parent
d81542752a
commit
da21075480
5 changed files with 19 additions and 14 deletions
|
|
@ -87,7 +87,7 @@ msecnode_t* sector_list = NULL; // phares 3/16/98
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
static bool PIT_FindFloorCeiling (line_t *ld, const FBoundingBox &box, FCheckPosition &tmf, bool only3d)
|
||||
static bool PIT_FindFloorCeiling (line_t *ld, const FBoundingBox &box, FCheckPosition &tmf, int flags)
|
||||
{
|
||||
if (box.Right() <= ld->bbox[BOXLEFT]
|
||||
|| box.Left() >= ld->bbox[BOXRIGHT]
|
||||
|
|
@ -115,7 +115,7 @@ static bool PIT_FindFloorCeiling (line_t *ld, const FBoundingBox &box, FCheckPos
|
|||
(ld->backsector->ceilingplane.a | ld->backsector->ceilingplane.b)) == 0)
|
||||
&& ld->backsector->e->XFloor.ffloors.Size()==0 && ld->frontsector->e->XFloor.ffloors.Size()==0)
|
||||
{
|
||||
P_LineOpening (open, tmf.thing, ld, sx=tmf.x, sy=tmf.y, tmf.x, tmf.y, only3d);
|
||||
P_LineOpening (open, tmf.thing, ld, sx=tmf.x, sy=tmf.y, tmf.x, tmf.y, flags);
|
||||
}
|
||||
else
|
||||
{ // Find the point on the line closest to the actor's center, and use
|
||||
|
|
@ -127,16 +127,16 @@ static bool PIT_FindFloorCeiling (line_t *ld, const FBoundingBox &box, FCheckPos
|
|||
(dx*dx + dy*dy) * 16777216.f);
|
||||
if (r <= 0)
|
||||
{
|
||||
P_LineOpening (open, tmf.thing, ld, sx=ld->v1->x, sy=ld->v1->y, tmf.x, tmf.y, only3d);
|
||||
P_LineOpening (open, tmf.thing, ld, sx=ld->v1->x, sy=ld->v1->y, tmf.x, tmf.y, flags);
|
||||
}
|
||||
else if (r >= (1<<24))
|
||||
{
|
||||
P_LineOpening (open, tmf.thing, ld, sx=ld->v2->x, sy=ld->v2->y, tmf.thing->x, tmf.thing->y, only3d);
|
||||
P_LineOpening (open, tmf.thing, ld, sx=ld->v2->x, sy=ld->v2->y, tmf.thing->x, tmf.thing->y, flags);
|
||||
}
|
||||
else
|
||||
{
|
||||
P_LineOpening (open, tmf.thing, ld, sx=ld->v1->x + MulScale24 (r, ld->dx),
|
||||
sy=ld->v1->y + MulScale24 (r, ld->dy), tmf.x, tmf.y, only3d);
|
||||
sy=ld->v1->y + MulScale24 (r, ld->dy), tmf.x, tmf.y, flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -233,6 +233,10 @@ void P_FindFloorCeiling (AActor *actor, int flags)
|
|||
tmf.y = actor->y;
|
||||
tmf.z = actor->z;
|
||||
|
||||
if (flags & FFCF_ONLYSPAWNPOS)
|
||||
{
|
||||
flags |= FFCF_3DMIDTEXRESTRICT;
|
||||
}
|
||||
if (!(flags & FFCF_ONLYSPAWNPOS))
|
||||
{
|
||||
P_GetFloorCeilingZ(tmf, flags);
|
||||
|
|
@ -266,7 +270,7 @@ void P_FindFloorCeiling (AActor *actor, int flags)
|
|||
|
||||
while ((ld = it.Next()))
|
||||
{
|
||||
PIT_FindFloorCeiling(ld, box, tmf, !!(flags & FFCF_ONLY3DFLOORS));
|
||||
PIT_FindFloorCeiling(ld, box, tmf, flags);
|
||||
}
|
||||
|
||||
if (tmf.touchmidtex) tmf.dropoffz = tmf.floorz;
|
||||
|
|
@ -342,7 +346,7 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr
|
|||
thing->z = z;
|
||||
while ((ld = it.Next()))
|
||||
{
|
||||
PIT_FindFloorCeiling(ld, box, tmf, false);
|
||||
PIT_FindFloorCeiling(ld, box, tmf, 0);
|
||||
}
|
||||
thing->z = savedz;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue