Skip to content

Commit af93a26

Browse files
committed
Fixed asteroids stopping generating
1 parent fc70fc9 commit af93a26

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

OpenRocket/OpenRocket/Game.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -463,16 +463,10 @@ void Game::UpdateAsteroids() {
463463
});
464464

465465
asteroids.erase(end, asteroids.end());
466-
int count = 0;
467-
for (auto& asteroid : asteroids) {
468-
string previousState = asteroid->getCurrentZone();
469-
asteroid->updateState();
470-
string newState = asteroid->getCurrentZone();
471-
if (previousState != newState) {
472-
count++;
473-
}
466+
467+
while (asteroids.size() < Constants::nrOfAsteroidsPerFrame) {
468+
Game::GenerateAsteroids(1);
474469
}
475-
Game::GenerateAsteroids(count);
476470
}
477471

478472
float Game::generateOffset(float leftOffset, float rightOffset, const string offsetType) {

0 commit comments

Comments
 (0)