# HG changeset patch # User Mike Becker # Date 1784889882 -7200 # Node ID 5336e985bd6988215e4a18dce6015c9fadda6e92 # Parent bad2d6d4b8619ce399c31f3f2331d880f8499b2f rename INVALID_POSITION to PIECE_NOT_FOUND because that is really what it is used for diff -r bad2d6d4b861 -r 5336e985bd69 src/chess/rules.c --- 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; } } diff -r bad2d6d4b861 -r 5336e985bd69 src/chess/rules.h --- a/src/chess/rules.h Fri Jul 24 12:42:57 2026 +0200 +++ b/src/chess/rules.h Fri Jul 24 12:44:42 2026 +0200 @@ -36,7 +36,7 @@ #define VALID_MOVE_SYNTAX 0 #define VALID_MOVE_SEMANTICS 0 /* use same code for a success */ #define INVALID_MOVE_SYNTAX 1 -#define INVALID_POSITION 2 +#define PIECE_NOT_FOUND 2 #define AMBIGUOUS_MOVE 3 #define NEED_PROMOTION 4 #define PIECE_PINNED 5 diff -r bad2d6d4b861 -r 5336e985bd69 src/main.c --- a/src/main.c Fri Jul 24 12:42:57 2026 +0200 +++ b/src/main.c Fri Jul 24 12:44:42 2026 +0200 @@ -358,7 +358,7 @@ case AMBIGUOUS_MOVE: printw("Ambiguous move - please specify the piece to move."); break; - case INVALID_POSITION: + case PIECE_NOT_FOUND: printw("No piece can be moved this way."); break; case NEED_PROMOTION: