Currently, a side can make a move, even if this move results in its own king getting checked. This should not be possible.
Instead, possible moves should be filtered to only keep moves that do not result in the king getting checked. If there are no such moves, the game ends in stalemate.
Currently, a side can make a move, even if this move results in its own king getting checked. This should not be possible.
Instead, possible moves should be filtered to only keep moves that do not result in the king getting checked. If there are no such moves, the game ends in stalemate.