Skip to content

Commit

Permalink
fixed a bug where diagonal non empty cells can be retrieved on pendin…
Browse files Browse the repository at this point in the history
…g fall moves
  • Loading branch information
ninetailsrabbit committed Jun 16, 2024
1 parent f7b6e86 commit f2fd568
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Match3Maker/Match3Maker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<PropertyGroup>
<Title>Ninetailsrabbit.Match3Maker</Title>
<Version>1.1.6</Version>
<Version>1.1.7</Version>
<Description>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</Description>
<Copyright>© 2024 Ninetailsrabbit</Copyright>
<Authors>Ninetailsrabbit</Authors>
Expand Down
3 changes: 2 additions & 1 deletion Match3Maker/src/components/Board.cs
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,8 @@ public List<GridCell> PendingFallMoves(IEnumerable<GridCell>? cells = null) {

return cells.Where(cell => cell.HasPiece() && cell.Piece.Type.CanBeMoved() && cell.NeighbourBottom is not null)
.Where(cell => (SelectedFillMode.Equals(FILL_MODES.FALL_DOWN) && cell.NeighbourBottom.IsEmpty()) ||
(SelectedFillMode.Equals(FILL_MODES.SIDE_DOWN) && (cell.NeighbourBottom.IsEmpty() || cell.NeighbourBottom.HasPiece()) && (cell.DiagonalNeighbourBottomRight.IsEmpty() || cell.DiagonalNeighbourBottomLeft.IsEmpty()))
(SelectedFillMode.Equals(FILL_MODES.SIDE_DOWN) && (cell.NeighbourBottom.IsEmpty() || cell.NeighbourBottom.HasPiece())
&& (cell.DiagonalNeighbourBottomRight is not null && cell.DiagonalNeighbourBottomRight.IsEmpty() || cell.DiagonalNeighbourBottomLeft is not null && cell.DiagonalNeighbourBottomLeft.IsEmpty()))
)
.ToList();
}
Expand Down

0 comments on commit f2fd568

Please sign in to comment.