diff options
| author | Tom Smeding <tom.smeding@gmail.com> | 2018-08-20 23:27:57 +0200 |
|---|---|---|
| committer | Tom Smeding <tom.smeding@gmail.com> | 2018-08-20 23:27:57 +0200 |
| commit | f62f1505da4cd68246ce40ad3cbccd81df1189df (patch) | |
| tree | 4b5b87fb42ac42defff7f9666c5a7d6c823aa20b | |
| parent | 77b736988cbaef25dc5ec50d775421394a4dc033 (diff) | |
Don't try to save scores on player timeout
| -rw-r--r-- | main.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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<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(); |
