mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- iterating through portal groups must check for situations where badly constructed maps let items end up in another portal group.
This commit is contained in:
parent
1e9fdca755
commit
6107f36ad2
2 changed files with 19 additions and 10 deletions
|
@ -809,11 +809,13 @@ bool FMultiBlockLinesIterator::GoUp(double x, double y)
|
|||
{
|
||||
if (!cursector->PortalBlocksMovement(sector_t::ceiling))
|
||||
{
|
||||
startIteratorForGroup(cursector->GetOppositePortalGroup(sector_t::ceiling));
|
||||
portalflags = FFCF_NOFLOOR;
|
||||
return true;
|
||||
if (startIteratorForGroup(cursector->GetOppositePortalGroup(sector_t::ceiling)))
|
||||
{
|
||||
portalflags = FFCF_NOFLOOR;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else continueup = false;
|
||||
continueup = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -830,11 +832,13 @@ bool FMultiBlockLinesIterator::GoDown(double x, double y)
|
|||
{
|
||||
if (!cursector->PortalBlocksMovement(sector_t::floor))
|
||||
{
|
||||
startIteratorForGroup(cursector->GetOppositePortalGroup(sector_t::floor));
|
||||
portalflags = FFCF_NOCEILING;
|
||||
return true;
|
||||
if (startIteratorForGroup(cursector->GetOppositePortalGroup(sector_t::floor)))
|
||||
{
|
||||
portalflags = FFCF_NOCEILING;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else continuedown = false;
|
||||
continuedown = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -906,14 +910,19 @@ bool FMultiBlockLinesIterator::Next(FMultiBlockLinesIterator::CheckResult *item)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void FMultiBlockLinesIterator::startIteratorForGroup(int group)
|
||||
bool FMultiBlockLinesIterator::startIteratorForGroup(int group)
|
||||
{
|
||||
offset = Displacements.getOffset(basegroup, group);
|
||||
offset.X += checkpoint.X;
|
||||
offset.Y += checkpoint.Y;
|
||||
cursector = group == startsector->PortalGroup ? startsector : P_PointInSector(offset);
|
||||
// If we ended up in a different group,
|
||||
// presumably because the spot to be checked is too far outside the actual portal group,
|
||||
// the search needs to abort.
|
||||
if (cursector->PortalGroup != group) return false;
|
||||
bbox.setBox(offset.X, offset.Y, checkpoint.Z);
|
||||
blockIterator.init(bbox);
|
||||
return true;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
|
@ -240,7 +240,7 @@ class FMultiBlockLinesIterator
|
|||
|
||||
bool GoUp(double x, double y);
|
||||
bool GoDown(double x, double y);
|
||||
void startIteratorForGroup(int group);
|
||||
bool startIteratorForGroup(int group);
|
||||
|
||||
public:
|
||||
|
||||
|
|
Loading…
Reference in a new issue