commit - 753b08883cf730f31e20a37cb4349a4b9b505ef8
commit + ff845530ea3f082d2c65099e19f4a30b85841068
blob - 3fc0f15e6ac5d6486be834cc4fd58a135210577b
blob + 48d7c95ee8998f3f0e8e99264336dc5e7cc69126
--- FICS/gameproc.c
+++ FICS/gameproc.c
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