Map Analysis Mode: fixed a crash when the sidedef of 1-sided lines had upper/lower textures defined. Fixes #533

This commit is contained in:
biwa 2021-02-23 16:26:31 +01:00
parent 1e3cf5ccec
commit d3a578c6cc

View file

@ -310,7 +310,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
return ((int)Tools.GetSidedefMiddleOffsetY(target, target.OffsetY + GetSidedefValue(target, matchingparttype, "offsety", 0f), linescaley, false) + partheight) % textureheight;
}
if(target.HighTexture == texturename
// Only check upper and lower textures if the sidedef as an other side. See https://github.com/jewalky/UltimateDoomBuilder/issues/533
if (target.Other != null && target.HighTexture == texturename
&& partsize.IntersectsWith(BuilderModesTools.GetSidedefPartSize(target, VisualGeometryType.WALL_UPPER)))
{
matchingparttype = VisualGeometryType.WALL_UPPER;
@ -318,7 +319,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
return ((int)Tools.GetSidedefTopOffsetY(target, target.OffsetY + GetSidedefValue(target, matchingparttype, "offsety", 0f), linescaley, false) + partheight) % textureheight;
}
if(target.LowTexture == texturename
if (target.Other != null && target.LowTexture == texturename
&& partsize.IntersectsWith(BuilderModesTools.GetSidedefPartSize(target, VisualGeometryType.WALL_LOWER)))
{
matchingparttype = VisualGeometryType.WALL_LOWER;