fixed forteitary wins for special game variations
authorH.G. Muller <h.g.muller@hccnet.nl>
Thu, 11 Jun 2009 04:22:36 +0000 (21:22 -0700)
committerArun Persaud <arun@nubati.net>
Thu, 11 Jun 2009 04:22:36 +0000 (21:22 -0700)
feature that corrects forfeitary wins (e.g. on time) of a bare King to draws of course breaks proper operation in losers, suicide and giveaway

backend.c

index b2dad3b..e3f1cee 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -7832,7 +7832,9 @@ GameEnds(result, resultDetails, whosays)
            }\r
            /* [HGM] bare: don't allow bare King to win */\r
            if((gameInfo.holdingsWidth == 0 || gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat)\r
-                        && result != GameIsDrawn)\r
+              && gameInfo.variant != VariantLosers && gameInfo.variant != VariantGiveaway \r
+              && gameInfo.variant != VariantSuicide // [HGM] losers: except in losers, of course...\r
+              && result != GameIsDrawn)\r
            {   int i, j, k=0, color = (result==WhiteWins ? (int)WhitePawn : (int)BlackPawn);\r
                for(j=BOARD_LEFT; j<BOARD_RGHT; j++) for(i=0; i<BOARD_HEIGHT; i++) {\r
                        int p = (int)boards[forwardMostMove][i][j] - color;\r