From 28b4a46336cdd0b1cc7d83c7d6664f4a75806bb9 Mon Sep 17 00:00:00 2001 From: tiehuis Date: Wed, 30 Dec 2015 11:35:35 +1300 Subject: [PATCH] Fix blocks incorrectly spawning on no field change See https://github.com/Tiehuis/2048-cli/issues/14. --- src/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.c b/src/main.c index 87df44e..f6e6644 100644 --- a/src/main.c +++ b/src/main.c @@ -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);