Skip to content

Commit 8c31bef

Browse files
committed
Fix crash when attempting to draw a base node for a building that has a bib with an empty first frame
1 parent e741426 commit 8c31bef

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/TSMapEditor/Rendering/MapView.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ private void DrawBaseNode(GraphicalBaseNode graphicalBaseNode)
10431043
int yDrawOffset = Constants.CellSizeY / -2;
10441044
int frameIndex = 0;
10451045

1046-
if ((graphics == null || graphics.GetFrame(frameIndex) == null) && bibGraphics == null)
1046+
if ((graphics == null || graphics.GetFrame(frameIndex) == null) && (bibGraphics == null || bibGraphics.GetFrame(0) == null))
10471047
{
10481048
DrawStringWithShadow(iniName, 1, drawPoint.ToXNAVector(), replacementColor, 1.0f);
10491049
return;
@@ -1054,6 +1054,7 @@ private void DrawBaseNode(GraphicalBaseNode graphicalBaseNode)
10541054
if (bibGraphics != null)
10551055
{
10561056
PositionedTexture bibFrame = bibGraphics.GetFrame(0);
1057+
10571058
texture = bibFrame.Texture;
10581059

10591060
int bibFinalDrawPointX = drawPoint.X - bibFrame.ShapeWidth / 2 + bibFrame.OffsetX + Constants.CellSizeX / 2;

0 commit comments

Comments
 (0)