diff --git a/package-lock.json b/package-lock.json index 03cd95a..3e95046 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "fenfurnace", - "version": "0.2.4", + "version": "0.2.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "fenfurnace", - "version": "0.2.4", + "version": "0.2.5", "license": "ISC", "devDependencies": { "html-webpack-plugin": "^5.3.1", diff --git a/package.json b/package.json index 4642428..0fa29d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fenfurnace", - "version": "0.2.4", + "version": "0.2.5", "description": "A chess engine designed to work entirely from a FEN position.", "keywords": [ "chess", diff --git a/src/validation.js b/src/validation.js index 8eaa763..14e3b29 100644 --- a/src/validation.js +++ b/src/validation.js @@ -183,10 +183,10 @@ export function makeMove(startCell, endCell, { isTest } = {}) { } //if rook or king make castling invalid - if (piece === 'k') { + if (piece.toLowerCase() === 'k') { global.castling[colour] = { k: false, q: false }; - } else if (piece === 'r') { - const isKingside = startCell === 'H'; + } else if (piece.toLowerCase() === 'r') { + const isKingside = startCell[0] === 'H'; const side = isKingside ? 'k' : 'q'; global.castling[colour][side] = false; }