Skip to content

Commit 46e5adb

Browse files
committed
Fix crash when smudges larger than 1x1 are rendered off the edge of the map
1 parent 13f2bcd commit 46e5adb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/TSMapEditor/GameMath/CellMath.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public static float GetDepthForCell(Point2D cellCoords, Map map)
234234
height = tile.Level;
235235
}
236236

237-
return ((CellTopLeftPointFromCellCoords(tile.CoordsToPoint(), map).Y + Constants.CellSizeY) / (float)map.HeightInPixelsWithCellHeight) * Constants.DownwardsDepthRenderSpace +
237+
return ((CellTopLeftPointFromCellCoords(cellCoords, map).Y + Constants.CellSizeY) / (float)map.HeightInPixelsWithCellHeight) * Constants.DownwardsDepthRenderSpace +
238238
(height * Constants.DepthRenderStep);
239239
}
240240
}

0 commit comments

Comments
 (0)