Allow promoting to any piece

This commit is contained in:
Juhani Krekelä 2021-01-10 20:35:45 +02:00
parent 5ef202d1b5
commit bc979fee2f
1 changed files with 1 additions and 5 deletions

View File

@ -348,13 +348,9 @@
case 'B':
case 'N':
case 'R':
promotion = move.slice(index, index + 1);
break;
case 'K':
return {error: 'Cannot promote a piece to king'};
break;
case 'P':
return {error: 'Cannot promote a piece to pawn'};
promotion = move.slice(index, index + 1);
break;
default:
return {error: 'Unrecognized piece: ' + move.slice(index, index + 1)};