mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 05:31:00 +00:00
- fixed some problems with the stepping up through a portal logic:
* this has to be disabled for missiles which should explode instead of stepping up. * interpolation adjustment was not correct * it could crash because the target portal group could be retrieved from a non-portal sector.
This commit is contained in:
parent
e55bbd7ba3
commit
910a3062c7
1 changed files with 8 additions and 4 deletions
|
@ -898,7 +898,9 @@ bool PIT_CheckLine(FMultiBlockLinesIterator &mit, FMultiBlockLinesIterator::Chec
|
|||
}
|
||||
|
||||
// check if the actor can step through the ceiling portal. In this case one-sided lines in the current area should not block
|
||||
if (!cres.line->frontsector->PortalBlocksMovement(sector_t::ceiling))
|
||||
// Use the same rules for stepping through a portal as for non-portal case.
|
||||
bool ismissile = (tm.thing->flags & MF_MISSILE) && !(tm.thing->flags6 & MF6_STEPMISSILE) && !(tm.thing->flags3 & MF3_FLOORHUGGER);
|
||||
if (!ismissile && !cres.line->frontsector->PortalBlocksMovement(sector_t::ceiling))
|
||||
{
|
||||
double portz = cres.line->frontsector->GetPortalPlaneZ(sector_t::ceiling);
|
||||
if (tm.thing->Z() < portz && tm.thing->Z() + tm.thing->MaxStepHeight >= portz && tm.floorz < portz)
|
||||
|
@ -1008,7 +1010,9 @@ bool PIT_CheckLine(FMultiBlockLinesIterator &mit, FMultiBlockLinesIterator::Chec
|
|||
FLineOpening open;
|
||||
|
||||
P_LineOpening(open, tm.thing, ld, ref, &cres.Position, cres.portalflags);
|
||||
if (!tm.thing->Sector->PortalBlocksMovement(sector_t::ceiling))
|
||||
// Use the same rules for stepping through a portal as for non-portal case.
|
||||
bool ismissile = (tm.thing->flags & MF_MISSILE) && !(tm.thing->flags6 & MF6_STEPMISSILE) && !(tm.thing->flags3 & MF3_FLOORHUGGER);
|
||||
if (!ismissile && !tm.thing->Sector->PortalBlocksMovement(sector_t::ceiling))
|
||||
{
|
||||
sector_t *oppsec = cres.line->frontsector == tm.thing->Sector ? cres.line->backsector : cres.line->frontsector;
|
||||
if (oppsec->PortalBlocksMovement(sector_t::ceiling))
|
||||
|
@ -2707,8 +2711,8 @@ bool P_TryMove(AActor *thing, const DVector2 &pos,
|
|||
FLinkContext ctx;
|
||||
DVector3 oldpos = thing->Pos();
|
||||
thing->UnlinkFromWorld(&ctx);
|
||||
thing->SetXYZ(thing->PosRelative(thing->Sector->GetOppositePortalGroup(sector_t::ceiling)));
|
||||
thing->Prev = thing->Pos() - oldpos;
|
||||
thing->SetXYZ(thing->PosRelative(tm.portalgroup));
|
||||
thing->Prev += thing->Pos() - oldpos;
|
||||
thing->Sector = P_PointInSector(thing->Pos());
|
||||
thing->PrevPortalGroup = thing->Sector->PortalGroup;
|
||||
thing->LinkToWorld(&ctx);
|
||||
|
|
Loading…
Reference in a new issue