aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/gameproc.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-03-30 13:29:04 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2024-03-30 13:29:04 +0100
commitff845530ea3f082d2c65099e19f4a30b85841068 (patch)
tree81c41a27249c499098b5f1061456067faf325d82 /FICS/gameproc.c
parent753b08883cf730f31e20a37cb4349a4b9b505ef8 (diff)
Reformatted was_promoted()
Diffstat (limited to 'FICS/gameproc.c')
-rw-r--r--FICS/gameproc.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/FICS/gameproc.c b/FICS/gameproc.c
index 3fc0f15..48d7c95 100644
--- a/FICS/gameproc.c
+++ b/FICS/gameproc.c
@@ -269,24 +269,24 @@ PUBLIC void game_ended(int g, int winner, int why)
game_finish(g);
}
-PRIVATE int was_promoted(game *g, int f, int r)
+PRIVATE int
+was_promoted(game *g, int f, int r)
{
#define BUGHOUSE_PAWN_REVERT 1
-#ifdef BUGHOUSE_PAWN_REVERT
- int i;
-
- for (i = g->numHalfMoves-2; i > 0; i -= 2) {
- if (g->moveList[i].toFile == f && g->moveList[i].toRank == r) {
- if (g->moveList[i].piecePromotionTo)
- return 1;
- if (g->moveList[i].fromFile == ALG_DROP)
- return 0;
- f = g->moveList[i].fromFile;
- r = g->moveList[i].fromRank;
- }
- }
+#if BUGHOUSE_PAWN_REVERT
+ for (int i = g->numHalfMoves-2; i > 0; i -= 2) {
+ if (g->moveList[i].toFile == f &&
+ g->moveList[i].toRank == r) {
+ if (g->moveList[i].piecePromotionTo)
+ return 1;
+ if (g->moveList[i].fromFile == ALG_DROP)
+ return 0;
+ f = g->moveList[i].fromFile;
+ r = g->moveList[i].fromRank;
+ }
+ }
#endif
- return 0;
+ return 0;
}
PUBLIC int