From 802da53cd37dc05e3f3660b6a68323d64e834ce1 Mon Sep 17 00:00:00 2001 From: tenmore <61951543+akatenmore@users.noreply.github.com> Date: Fri, 11 Jun 2021 08:16:17 +1200 Subject: [PATCH] Release 0.2.5 (#10) * castling bug fix * Update package.json * Release 0.2.5 Co-authored-by: Nixinova <42429413+Nixinova@users.noreply.github.com> --- package-lock.json | 4 ++-- package.json | 2 +- src/validation.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) 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; }