src/chess/rules.c

changeset 154
5336e985bd69
parent 153
bad2d6d4b861
child 155
835776e0338f
--- a/src/chess/rules.c	Fri Jul 24 12:42:57 2026 +0200
+++ b/src/chess/rules.c	Fri Jul 24 12:44:42 2026 +0200
@@ -350,7 +350,7 @@
     /* does piece exist */
     if ((msrc(gamestate->board, move)&(PIECE_MASK|COLOR_MASK))
            != (move->piece&(PIECE_MASK|COLOR_MASK))) {
-        return INVALID_POSITION;
+        return PIECE_NOT_FOUND;
     }
     
     /* can't capture own pieces */
@@ -683,7 +683,7 @@
     if (get_threats(gamestate, move->torow, move->tofile, color,
             threats, &threatcount)) {
         
-        int reason = INVALID_POSITION;
+        int reason = PIECE_NOT_FOUND;
         
         /* find threats for the specified position */
         for (uint8_t i = 0 ; i < threatcount ; i++) {            
@@ -718,7 +718,7 @@
         move->fromfile = threat->fromfile;
         return VALID_MOVE_SYNTAX;
     } else {
-        return INVALID_POSITION;
+        return PIECE_NOT_FOUND;
     }
 }
 

mercurial