diff options
-rw-r--r-- | src/game.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/game.cpp b/src/game.cpp index b5d667a..66b488c 100644 --- a/src/game.cpp +++ b/src/game.cpp | |||
@@ -920,10 +920,14 @@ void Game::updatePlaying(size_t frameTime) { | |||
920 | } | 920 | } |
921 | } | 921 | } |
922 | 922 | ||
923 | std::uniform_int_distribution<int> lampDist(0, lamps.size() - 1); | 923 | if (lamps.empty()) { |
924 | std::tuple<int, int> popPos = lamps[lampDist(rng)]; | 924 | losing = LoseState::PoppingPlayer; |
925 | } else { | ||
926 | std::uniform_int_distribution<int> lampDist(0, lamps.size() - 1); | ||
927 | std::tuple<int, int> popPos = lamps[lampDist(rng)]; | ||
925 | 928 | ||
926 | popLamp(std::get<0>(popPos), std::get<1>(popPos), 1); | 929 | popLamp(std::get<0>(popPos), std::get<1>(popPos), 1); |
930 | } | ||
927 | } | 931 | } |
928 | } | 932 | } |
929 | 933 | ||