From: H.G. Muller Date: Sat, 26 Jan 2013 17:08:37 +0000 (+0100) Subject: Adjudicate pawn-drop mate as loss in Shogi X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=94f3427e1b21ef9242770d4889a67fd024b9c897;p=xboard.git Adjudicate pawn-drop mate as loss in Shogi Mating with a Pawn drop is illegal in Shogi, but rather than burdoning the legality-testing by this complex rule, we simply invert the result for such a mate. After all, Shogi customs are such that everything illegal leads to an immediate loss. --- diff --git a/backend.c b/backend.c index 67e2d1b..2028269 100644 --- a/backend.c +++ b/backend.c @@ -7764,6 +7764,14 @@ Adjudicate (ChessProgramState *cps) case MT_CHECKMATE: reason = "Xboard adjudication: Checkmate"; boards[forwardMostMove][EP_STATUS] = (gameInfo.variant == VariantLosers ? EP_WINS : EP_CHECKMATE); + if(gameInfo.variant == VariantShogi) { + if(forwardMostMove > backwardMostMove + && moveList[forwardMostMove-1][1] == '@' + && CharToPiece(ToUpper(moveList[forwardMostMove-1][0])) == WhitePawn) { + reason = "XBoard adjudication: pawn-drop mate"; + boards[forwardMostMove][EP_STATUS] = EP_WINS; + } + } break; }