Fix blocks incorrectly spawning on no field change

See https://github.com/Tiehuis/2048-cli/issues/14.
This commit is contained in:
tiehuis 2015-12-30 11:35:35 +13:00
parent cd13ef000f
commit 28b4a46336

View File

@ -57,6 +57,9 @@ get_new_key:;
gamestate_tick(s, g, direction, g->opts->animate && g->opts->interactive
? draw_then_sleep : NULL);
if (g->moved == 0)
goto get_new_key;
int spawned;
for (spawned = 0; spawned < g->opts->spawn_rate; spawned++)
gamestate_new_block(g);