Fix crazyhouse illegal drop move crash

Closes #2746
This commit is contained in:
Vincent Velociter
2026-03-11 14:02:58 +01:00
parent dd5e84636d
commit 8f06301753
5 changed files with 6 additions and 5 deletions
@@ -237,6 +237,9 @@ sealed class BoardPrefs with _$BoardPrefs implements Serializable {
promotionMove: promotionMove,
sideToMove: position.turn,
validMoves: _makeLegalMoves(position, variant: variant, castlingMethod: castlingMethod),
droppable: variant == Variant.crazyhouse
? (validDropSquares: position.legalDrops.squares.toISet())
: null,
isCheck: boardHighlights && position.isCheck,
canPromoteToKing: variant == Variant.antichess,
);
@@ -167,7 +167,6 @@ abstract class AnalysisBoardState<
onClearShapes: _onClearShapes,
newShapeColor: boardPrefs.shapeColor.color,
),
enableDropMoves: analysisState.variant.hasDropMoves,
),
);
}
-1
View File
@@ -172,7 +172,6 @@ class _GameLayoutState extends ConsumerState<GameLayout> {
onClearShapes: _onClearShapes,
newShapeColor: boardPrefs.shapeColor.color,
),
enableDropMoves: widget.boardParams.variant.hasDropMoves == true,
);
final settings = widget.boardSettingsOverrides != null
+2 -2
View File
@@ -181,10 +181,10 @@ packages:
dependency: "direct main"
description:
name: chessground
sha256: f297ef59e535f05f90ddfc1de612da7ea1b58ef84a2b7807df72cc8c43d812d4
sha256: e2545b2475259c5665e7c6162affa6dbcb7dd3eb3050f603162833fbb7a8a260
url: "https://pub.dev"
source: hosted
version: "8.2.1"
version: "9.0.0"
cli_config:
dependency: transitive
description:
+1 -1
View File
@@ -14,7 +14,7 @@ dependencies:
app_settings: ^7.0.0
async: ^2.10.0
auto_size_text: ^3.0.0
chessground: ^8.0.1
chessground: ^9.0.0
clock: ^1.1.1
collection: ^1.17.0
connectivity_plus: ^7.0.0