From 2db2174e2ca116581f534e943b252eb3eebac41c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Stompo=CC=81r?= Date: Wed, 21 Jan 2026 16:41:16 +0100 Subject: [PATCH] Ensure that two pieces don't overlap --- Chess/Common/Game/Game.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Chess/Common/Game/Game.swift b/Chess/Common/Game/Game.swift index 03d3059..7d70055 100644 --- a/Chess/Common/Game/Game.swift +++ b/Chess/Common/Game/Game.swift @@ -90,9 +90,11 @@ class Game { } moves.append(Move(who: piece, from: position, to: nil)) } - moves += [Move(who: selectedPiece, - from: fromField, - to: field)] + if !action.piecesToRemove.contains(selectedPiece) { + moves += [Move(who: selectedPiece, + from: fromField, + to: field)] + } for addAction in action.piecesToAdd { moves.append(Move(who: addAction.piece, from: nil, to: addAction.field)) }