summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2018-08-20 23:27:57 +0200
committerTom Smeding <tom.smeding@gmail.com>2018-08-20 23:27:57 +0200
commitf62f1505da4cd68246ce40ad3cbccd81df1189df (patch)
tree4b5b87fb42ac42defff7f9666c5a7d6c823aa20b
parent77b736988cbaef25dc5ec50d775421394a4dc033 (diff)
Don't try to save scores on player timeout
-rw-r--r--main.cpp13
1 files 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 &params) {
}
if (referee.gameEnded()) {
+ mres.status = MatchResult::Status::ok;
+
+ optional<vector<int>> oscores = referee.getScores();
+ assert(oscores);
+ mres.sc1 = oscores->at(0);
+ mres.sc2 = oscores->at(1);
+
goto match_done;
}
}
}
match_done:
- optional<vector<int>> 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();