RSG-Group/RSG-Chess-API

Prevent endless loops while simulating checkmate.

radi-cho opened this issue · 1 comments

Castling and En-passant simulation may cause endless loops if the board is not loaded with the standard chess positioning.

For example: The code validating castling possibility may result in endless loop in some games loaded from FEN strings: pieces.js#L309. xx < 8 && should be added to validate xx does not exceed 8. If it does, the loop becomes obsolete because the board doesn't support x to be greater than 7.