mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-17 01:22:18 +00:00
Fixed a potential crash when changing the ceiling texture to or from sky. Fixes #517
This commit is contained in:
parent
7cec462a15
commit
478690e08f
1 changed files with 12 additions and 6 deletions
|
@ -218,13 +218,19 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
else if(side.Other != null && side.Other.Sector != null && side.Other.Sector.CeilTexture == General.Map.Config.SkyFlatName)
|
||||
{
|
||||
// Update upper side of the neightbouring sector
|
||||
BaseVisualSector other = (BaseVisualSector)mode.GetVisualSector(side.Other.Sector);
|
||||
if(other != null && other.Sides != null)
|
||||
// Update upper side of the neightbouring sector, but only when the visual sector already exists. GetVisualSector will create
|
||||
// the visual sector when it does not exist yet, which in turn modifies the mode's allsectors list, which is illegal when done
|
||||
// from the mode's UpdateChangedObjects method, since that method iterates over allsectors.
|
||||
// See https://github.com/jewalky/UltimateDoomBuilder/issues/517
|
||||
if (mode.VisualSectorExists(side.Other.Sector))
|
||||
{
|
||||
parts = other.GetSidedefParts(side.Other);
|
||||
if(parts.upper != null && parts.upper.Triangles > 0)
|
||||
parts.upper.UpdateSkyRenderFlag();
|
||||
BaseVisualSector other = (BaseVisualSector)mode.GetVisualSector(side.Other.Sector);
|
||||
if (other != null && other.Sides != null)
|
||||
{
|
||||
parts = other.GetSidedefParts(side.Other);
|
||||
if (parts.upper != null && parts.upper.Triangles > 0)
|
||||
parts.upper.UpdateSkyRenderFlag();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue