Allow spawn rate option to work as intended

This commit is contained in:
Tiehuis
2015-02-23 10:12:01 +13:00
parent a75c200842
commit 375cdeb7da
2 changed files with 12 additions and 4 deletions
+4 -4
View File
@@ -47,18 +47,18 @@ get_new_key:;
/* Game will only end if 0 moves available */
if (game_running) {
/* Maybe change this behaviour so if we don't move, we still generate a block */
if (gamestate_tick(s, g, direction, g->opts->animate ? draw_then_sleep : NULL))
gamestate_tick(s, g, direction, g->opts->animate ? draw_then_sleep : NULL);
int spawned;
for (spawned = 0; spawned < g->opts->spawn_rate; spawned++)
gamestate_new_block(g);
if (gamestate_end_condition(g)) {
game_running = false;
goto game_end;
}
}
}
game_end:
gfx_destroy(s);
gamestate_clear(g);
return 0;