chiark / gitweb /
Stop animations on a new game, no matter how it is started.
authorJonas Kölker <jonaskoelker@yahoo.com>
Wed, 7 Oct 2015 22:17:19 +0000 (00:17 +0200)
committerSimon Tatham <anakin@pobox.com>
Wed, 14 Oct 2015 19:29:32 +0000 (20:29 +0100)
Animations were stopped if a new game was initiated with a keyboard
shortcut (n, N, Ctrl-N), but not via menu items such as presets or
custom configurations, nor (perhaps not a problem) on starting the
program. Fix this, so that animations are stopped on a new game no
matter how the new game is started.

midend.c

index 3107027963db09fdc2a89d41966311fedf62288d..c520c13c38aa81cd69aadb316a14c22b03be4575 100644 (file)
--- a/midend.c
+++ b/midend.c
@@ -355,6 +355,7 @@ void midend_force_redraw(midend *me)
 
 void midend_new_game(midend *me)
 {
+    midend_stop_anim(me);
     midend_free_game(me);
 
     assert(me->nstates == 0);
@@ -596,7 +597,6 @@ static int midend_really_process_key(midend *me, int x, int y, int button)
 
     if (!movestr) {
        if (button == 'n' || button == 'N' || button == '\x0E') {
-           midend_stop_anim(me);
            midend_new_game(me);
            midend_redraw(me);
            goto done;                 /* never animate */