diff --git a/Match3Maker/Match3Maker.csproj b/Match3Maker/Match3Maker.csproj index d90eaf2..64048ae 100644 --- a/Match3Maker/Match3Maker.csproj +++ b/Match3Maker/Match3Maker.csproj @@ -14,7 +14,7 @@ Ninetailsrabbit.Match3Maker - 1.1.7 + 1.1.8 This lightweight library provides the core logic and functionality you need to build engaging match-3 games. Focus on game design and mechanics while leaving the complex logic to this library © 2024 Ninetailsrabbit Ninetailsrabbit diff --git a/Match3Maker/src/components/Board.cs b/Match3Maker/src/components/Board.cs index b4c031c..4a346b5 100644 --- a/Match3Maker/src/components/Board.cs +++ b/Match3Maker/src/components/Board.cs @@ -550,8 +550,10 @@ public VirtualBoard MovePiecesAndFillEmptyCells() { currentCell.DiagonalNeighbourBottomRight; } - bottomCell.AssignPiece(currentCell.Piece); - currentCell.RemovePiece(); + if (bottomCell is not null && bottomCell.IsEmpty()) { + bottomCell.AssignPiece(currentCell.Piece); + currentCell.RemovePiece(); + } virtualBoard.AddUpdate(new BoardCellUpdate(UPDATE_TYPE.MOVEMENT, new(currentCell, bottomCell, bottomCell.Piece))); }