mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-16 09:11:17 +00:00
- don't allow any ceiling portal that has a lower position than a floor portal in the same sector. The will inevitably lead to problematic situations.
This commit is contained in:
parent
50d2145ba0
commit
f35d966799
1 changed files with 20 additions and 0 deletions
|
@ -1086,6 +1086,26 @@ void P_CreateLinkedPortals()
|
|||
sectors[i].lines[j]->flags |= ML_PORTALCONNECT;
|
||||
}
|
||||
}
|
||||
if (sectors[i].PortalIsLinked(sector_t::ceiling) && sectors[i].PortalIsLinked(sector_t::floor))
|
||||
{
|
||||
fixed_t cz = sectors[i].SkyBoxes[sector_t::ceiling]->threshold;
|
||||
fixed_t fz = sectors[i].SkyBoxes[sector_t::floor]->threshold;
|
||||
if (cz < fz)
|
||||
{
|
||||
// This is a fatal condition. We have to remove one of the two portals. Choose the one that doesn't match the current plane
|
||||
Printf("Error in sector %d: Ceiling portal at z=%d is below floor portal at z=%d\n", i, cz, fz);
|
||||
fixed_t cp = sectors[i].ceilingplane.Zat0();
|
||||
fixed_t fp = sectors[i].ceilingplane.Zat0();
|
||||
if (cp < fp || fz == fp)
|
||||
{
|
||||
sectors[i].SkyBoxes[sector_t::ceiling] = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
sectors[i].SkyBoxes[sector_t::floor] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//BuildBlockmap();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue