}
}
}
- if (this.epSquare_s)
+ if (!!this.epSquare_s)
this.enlightEnpassant();
}
readEpSquare_s(fenSquare_s) {
if (fenSquare_s == "-")
return undefined;
- let res = fenSquare_s.split(',').map(C.SquareToCoords);
- if (res.length == 1) //most common case
- return res[0];
- return res;
+ return fenSquare_s.split(',').map(C.SquareToCoords);
}
// Extract potential en-passant square from just played move
x: (s.x + e.x) / 2,
y: s.y
},
- e //add endpoint (to know where captured piece is)
+ e //always add final square (generally deduced)
];
}
}