diff options
-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(); |