aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/movecheck.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-05-05 18:00:22 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-05-05 18:00:22 +0200
commit23292834c0c4ba61cef39c47454141c8ca33d989 (patch)
tree8c59350321a0336a745f268ac469e74099420da5 /FICS/movecheck.c
parent5f838735df6917ff95b658f486d548928f59723d (diff)
Keep the old one
Diffstat (limited to 'FICS/movecheck.c')
-rw-r--r--FICS/movecheck.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/FICS/movecheck.c b/FICS/movecheck.c
index e3d1f51..a971c6d 100644
--- a/FICS/movecheck.c
+++ b/FICS/movecheck.c
@@ -289,23 +289,26 @@ PRIVATE int is_square_attacked (game_state_t *gs, int kf, int kr)
else return 0;
}
-/* old one:
-PRIVATE int is_square_attacked(game_state_t * gs, int kf, int kr)
+#if 0
+PRIVATE int
+is_square_attacked(game_state_t *gs, int kf, int kr)
{
- int f, r;
- gs->onMove = CToggle(gs->onMove);
+ int f, r;
- for (InitPieceLoop(gs->board, &f, &r, gs->onMove);
- NextPieceLoop(gs->board, &f, &r, gs->onMove);) {
- if (legal_move(gs, f, r, kf, kr)) {
- gs->onMove = CToggle(gs->onMove);
- return 1;
- }
- }
- gs->onMove = CToggle(gs->onMove);
- return 0;
+ gs->onMove = CToggle(gs->onMove);
+
+ for (InitPieceLoop(gs->board, &f, &r, gs->onMove);
+ NextPieceLoop(gs->board, &f, &r, gs->onMove);) {
+ if (legal_move(gs, f, r, kf, kr)) {
+ gs->onMove = CToggle(gs->onMove);
+ return 1;
+ }
+ }
+
+ gs->onMove = CToggle(gs->onMove);
+ return 0;
}
-*/
+#endif
PRIVATE int
legal_king_move(game_state_t *gs, int ff, int fr, int tf, int tr)