src/chess/rules.h

changeset 173
e541b6002933
parent 171
09f18c3316f9
--- a/src/chess/rules.h	Fri Aug 14 11:35:36 2026 +0200
+++ b/src/chess/rules.h	Fri Aug 14 13:40:26 2026 +0200
@@ -195,10 +195,13 @@
     return gamestate->board[row][file] & ENPASSANT_THREAT;
 }
 
+static inline bool is_game_drawn(const GameState *gamestate) {
+    return gamestate->threefold || gamestate->stalemate || gamestate->remis;
+}
+
 static inline bool is_game_running(const GameState *gamestate) {
     return !(gamestate->checkmate || gamestate->wresign || gamestate->bresign
-        || gamestate->threefold || gamestate->stalemate || gamestate->remis
-        || gamestate->review);
+        || is_game_drawn(gamestate) || gamestate->review);
 }
 
 static inline bool is_check_position(const GameState *gamestate) {

mercurial