From f62f1505da4cd68246ce40ad3cbccd81df1189df Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 20 Aug 2018 23:27:57 +0200 Subject: Don't try to save scores on player timeout --- main.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/main.cpp b/main.cpp index f2d0664..3dca757 100644 --- a/main.cpp +++ b/main.cpp @@ -287,18 +287,19 @@ static void playMatch(Player &p1, Player &p2, int index, const Params ¶ms) { } if (referee.gameEnded()) { + mres.status = MatchResult::Status::ok; + + optional> oscores = referee.getScores(); + assert(oscores); + mres.sc1 = oscores->at(0); + mres.sc2 = oscores->at(1); + goto match_done; } } } match_done: - optional> oscores = referee.getScores(); - assert(oscores); - mres.status = MatchResult::Status::ok; - mres.sc1 = oscores->at(0); - mres.sc2 = oscores->at(1); - for (int i = 0; i < 2; i++) { bool success = procs[i].writeLine("Stop"); procs[i].unStop(); -- cgit v1.2.3-70-g09d2