Limit multi-session clock handling to non-ICS games
authorH.G. Muller <h.g.muller@hccnet.nl>
Sun, 10 Oct 2010 19:03:29 +0000 (21:03 +0200)
committerArun Persaud <arun@nubati.net>
Sat, 16 Oct 2010 02:16:26 +0000 (19:16 -0700)
In ICS games a time forfeit crashed XBoard, apparently because the
fullTimeControl string is not properly set when we try to use it to see
if a sudden-death session is indeed the last session.

backend.c

index 6547358..257a806 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -14313,7 +14313,7 @@ DecrementClocks()
     if (WhiteOnMove(forwardMostMove)) {
        if(whiteNPS >= 0) lastTickLength = 0;
        timeRemaining = whiteTimeRemaining -= lastTickLength;
-        if(timeRemaining < 0) {
+        if(timeRemaining < 0 && !appData.icsActive) {
             GetTimeQuota((forwardMostMove-whiteStartMove-1)/2, 0, whiteTC); // sets suddenDeath & nextSession;
             if(suddenDeath) { // [HGM] if we run out of a non-last incremental session, go to the next
                 whiteStartMove = forwardMostMove; whiteTC = nextSession;
@@ -14325,7 +14325,7 @@ DecrementClocks()
     } else {
        if(blackNPS >= 0) lastTickLength = 0;
        timeRemaining = blackTimeRemaining -= lastTickLength;
-        if(timeRemaining < 0) { // [HGM] if we run out of a non-last incremental session, go to the next
+        if(timeRemaining < 0 && !appData.icsActive) { // [HGM] if we run out of a non-last incremental session, go to the next
             GetTimeQuota((forwardMostMove-blackStartMove-1)/2, 0, blackTC);
             if(suddenDeath) {
                 blackStartMove = forwardMostMove;