fix: getFEN
This commit is contained in:
@@ -416,6 +416,8 @@ export default class Chess {
|
||||
emptySquares = 0;
|
||||
}
|
||||
|
||||
if (emptySquares) position += `${emptySquares}`;
|
||||
|
||||
let castling = "";
|
||||
|
||||
if (this._castling.w & MOVE_FLAGS.K_CASTLE) castling += "K";
|
||||
@@ -423,6 +425,8 @@ export default class Chess {
|
||||
if (this._castling.b & MOVE_FLAGS.K_CASTLE) castling += "k";
|
||||
if (this._castling.b & MOVE_FLAGS.Q_CASTLE) castling += "q";
|
||||
|
||||
if (castling == "") castling = "-";
|
||||
|
||||
return [
|
||||
position.substring(1), // remove first '/'
|
||||
this._turn,
|
||||
|
||||
Reference in New Issue
Block a user