Hello! First of all, amazing plugin! My players love to play with it. I have noticed two tiny issues, which can be considered the same:
1 - A player can castle and get his own king in check (
https://i.imgur.com/4vggVBP.jpg), I captured the enemy king which should not happen
2 - A player can castle while an enemy piece guards one of the cells between the king and his arrival position (
https://i.imgur.com/7Z7mcyC.jpg), which is forbidden
3 (?) - I didn't try it, but castling while on check or when the king or the rook have moved is forbidden, could you verify this? Apart from these little details, you did a great job, thank you!