Skip to content

Commit

Permalink
Don't return early in game_ended check
Browse files Browse the repository at this point in the history
Make sure we update status of all players.
  • Loading branch information
lidavidm committed Dec 17, 2018
1 parent 4befaa6 commit 1729a86
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions game_engine/core/HaliteImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,10 @@ bool HaliteImpl::game_ended() const {
if (!player.terminated && can_play) {
num_alive_players++;
}
if (num_alive_players > 1) {
return false;
}
}

if (num_alive_players > 1) {
return false;
}
// If there is only one player in the game, then let them keep playing.
return !(game.store.players.size() == 1 && num_alive_players == 1);
Expand Down

0 comments on commit 1729a86

Please sign in to comment.