diff --git a/src/chess/King.java b/src/chess/King.java index 486ec09..eeb1369 100644 --- a/src/chess/King.java +++ b/src/chess/King.java @@ -54,9 +54,10 @@ public class King extends ChessPiece { private void castleRight(){ // casting has to move the rook on the right size of the king from white's perspective - if (this.isWhite) { - b.set(b.size() - 3, 0, b.get(b.size() - 1, 0)); - } else + if (this.isWhite) + b.movePiece(b.size() - 1, 0, b.size() - 3, 0); + else + b.movePiece(b.size()-1, b.size()-1, b.size()-3, b.size()-1) b.set(b.size()-3, b.size()-1, b.get(b.size()-1, b.size()-1)); }