From 085982e238267d18e0c6b192ca25a7b998631a42 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 6 May 2011 18:15:23 +0200 Subject: [PATCH] Fix exit popup in tourney mode Only the instance finishing the last tourney game will cause a popup with final standings. As long as there are still busy games, it exits or switches back to idle mode silently. --- backend.c | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/backend.c b/backend.c index 69b79e5..9204e1b 100644 --- a/backend.c +++ b/backend.c @@ -7085,7 +7085,7 @@ TourneyStandings(int display) case '-': bScore = 2; break; case '=': wScore = bScore = 1; break; case ' ': - case '*': return NULL; // tourney not finished + case '*': return strdup("busy"); // tourney not finished } score[w] += wScore; score[b] += bScore; @@ -10064,9 +10064,16 @@ GameEnds(result, resultDetails, whosays) ModeHighlight(); endingGame = 0; /* [HGM] crash */ if(popupRequested) { // [HGM] crash: this calls GameEnds recursively through ExitEvent! Make it a harmless tail recursion. - if(matchMode == TRUE) DisplayFatalError(ranking ? ranking : buf, 0, 0); else { - matchMode = FALSE; appData.matchGames = matchGame = roundNr = 0; - DisplayNote(ranking ? ranking : buf); + if(matchMode == TRUE) { // match through command line: exit with or without popup + if(ranking) { + if(strcmp(ranking, "busy")) DisplayFatalError(ranking, 0, 0); + else ExitEvent(0); + } else DisplayFatalError(buf, 0, 0); + } else { // match through menu; just stop, with or without popup + matchMode = FALSE; appData.matchGames = matchGame = roundNr = 0; + if(ranking){ + if(strcmp(ranking, "busy")) DisplayNote(ranking); + } else DisplayNote(buf); } if(ranking) free(ranking); } -- 1.7.0.4