Skip to content

Commit b3c552a

Browse files
committed
Fix edge case crash in terrain line painting functionality
1 parent 6f2a1f8 commit b3c552a

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/TSMapEditor/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace TSMapEditor
44
{
55
public static class Constants
66
{
7-
public const string ReleaseVersion = "1.8.6";
7+
public const string ReleaseVersion = "1.8.7";
88

99
public static int CellSizeX = 48;
1010
public static int CellSizeY = 24;

src/TSMapEditor/UI/CursorActions/PlaceTerrainCursorAction.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@ protected override Mutation CreateLinePlacementMutation(Direction direction, int
280280
protected override void ApplyLine(Point2D cellCoords)
281281
{
282282
var adjustedCellCoords = GetAdjustedCellCoords(cellCoords);
283+
284+
if (adjustedCellCoords == LineSourceCell.Value)
285+
return;
286+
283287
(Direction direction, int length) = GetLineInformation(adjustedCellCoords);
284288
var mutation = CreateLinePlacementMutation(direction, length);
285289
PerformMutation(mutation);

0 commit comments

Comments
 (0)