X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=4808895e0d84b46cf4ce1ac1517f8f275b1a0d32;hb=5514b4ae4147a322cb8c818e8bf25a785f881cc9;hp=322327937564315045683db715eb137f545b44fb;hpb=2dee3c0dc5b669d4e5f3464866b056a5bbca252e;p=xboard.git diff --git a/backend.c b/backend.c index 3223279..4808895 100644 --- a/backend.c +++ b/backend.c @@ -5458,8 +5458,6 @@ FinishMove(moveType, fromX, fromY, toX, toY, promoChar) } ModeHighlight(); } - ModeHighlight(); - } /* Relay move to ICS or chess engine */ if (appData.icsActive) @@ -5498,21 +5496,35 @@ FinishMove(moveType, fromX, fromY, toX, toY, promoChar) switch (gameMode) { case EditGame: - switch (MateTest(boards[currentMove], PosFlags(currentMove)) ) { - case MT_NONE: - case MT_CHECK: - break; - + switch (MateTest(boards[currentMove], PosFlags(currentMove)) ) + { + case MT_NONE: + case MT_CHECK: + break; + case MT_CHECKMATE: + case MT_STAINMATE: + if (WhiteOnMove(currentMove)) { + GameEnds(BlackWins, "Black mates", GE_PLAYER); + } else { + GameEnds(WhiteWins, "White mates", GE_PLAYER); + } + break; + case MT_STALEMATE: + GameEnds(GameIsDrawn, "Stalemate", GE_PLAYER); + break; + } + break; + case MachinePlaysBlack: case MachinePlaysWhite: /* disable certain menu options while machine is thinking */ SetMachineThinkingEnables(); break; - + default: break; } - + if(bookHit) { // [HGM] book: simulate book reply static char bookMove[MSG_SIZ]; // a bit generous?