Merge branch 'fix-visual-mode-crash' into 'master'

Fixes a (so I'm told) prominent crash related to undoing

See merge request STJr/ZoneBuilder!8
This commit is contained in:
sphere 2022-08-28 10:50:13 +00:00
commit fe4e8f1e5f
2 changed files with 10 additions and 2 deletions

View file

@ -256,6 +256,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
bool translucent = (extrafloor.RenderAdditive || extrafloor.RenderSubtractive || extrafloor.RenderReverseSubtractive || extrafloor.Alpha < 255);
foreach(Effect3DFloor ef in sd.ExtraFloors)
{
//Ashnal: sometimes we encounter other 3dfloors that havent been updated and have null floors/ceilings, lets update those first before continuing
if (ef.Ceiling == null)
ef.Update();
//mxd. Our poly should be clipped when our ond other extrafloors are both solid or both translucent,
// or when only our extrafloor is translucent.
// Our poly should not be clipped when our extrafloor is translucent and the other one isn't and both have renderinside setting.

View file

@ -219,9 +219,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
List<WallPolygon> polygons = new List<WallPolygon> { poly };
foreach(Effect3DFloor ef in sd.ExtraFloors)
{
//Ashnal: sometimes we encounter other 3dfloors that havent been updated and have null floors/ceilings, lets update those first before continuing
if (ef.Ceiling == null)
ef.Update();
//mxd. Our poly should be clipped when our ond other extrafloors are both solid or both translucent,
// or when only our extrafloor is translucent
if(ef.ClipSidedefs == extrafloor.ClipSidedefs || ef.ClipSidedefs)
// or when only our extrafloor is translucent
if (ef.ClipSidedefs == extrafloor.ClipSidedefs || ef.ClipSidedefs)
{
int num = polygons.Count;
for(int pi = 0; pi < num; pi++)