aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-05-05 18:02:29 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-05-05 18:02:29 +0200
commit96225bdb2cf993dcfe6423f3c606c7145cb28644 (patch)
tree2c3033015c17b54feaa22d27d26363548056ff9e
parent23292834c0c4ba61cef39c47454141c8ca33d989 (diff)
Reformatted is_square_attacked()
-rw-r--r--FICS/movecheck.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/FICS/movecheck.c b/FICS/movecheck.c
index a971c6d..6dc9e19 100644
--- a/FICS/movecheck.c
+++ b/FICS/movecheck.c
@@ -276,17 +276,23 @@ PRIVATE int legal_queen_move(game_state_t * gs, int ff, int fr, int tf, int tr)
* Used in castling from/through check testing.
*/
-/* new one from soso: */
-PRIVATE int is_square_attacked (game_state_t *gs, int kf, int kr)
+/*
+ * New one from soso
+ */
+PRIVATE int
+is_square_attacked(game_state_t *gs, int kf, int kr)
{
- game_state_t fakeMove;
-
- fakeMove = *gs;
- fakeMove.board[4][kr] = NOPIECE;
- fakeMove.board[kf][kr] = KING | fakeMove.onMove;
- fakeMove.onMove = CToggle (fakeMove.onMove);
- if (in_check(&fakeMove)) return 1;
- else return 0;
+ game_state_t fakeMove;
+
+ fakeMove = *gs;
+ fakeMove.board[4][kr] = NOPIECE;
+ fakeMove.board[kf][kr] = KING | fakeMove.onMove;
+ fakeMove.onMove = CToggle(fakeMove.onMove);
+
+ if (in_check(&fakeMove))
+ return 1;
+ else
+ return 0;
}
#if 0