shithub: puzzles

Download patch

ref: 156b0c3e23acc3aee3f8a4f7d94132ba227de751
parent: 11b14a5f44967a6257ac1beabb6425f95f3b2c69
author: Jonas Kölker <jonaskoelker@yahoo.com>
date: Wed Oct 7 20:17:19 EDT 2015

Stop animations on a new game, no matter how it is started.

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.

--- a/midend.c
+++ b/midend.c
@@ -355,6 +355,7 @@
 
 void midend_new_game(midend *me)
 {
+    midend_stop_anim(me);
     midend_free_game(me);
 
     assert(me->nstates == 0);
@@ -596,7 +597,6 @@
 
     if (!movestr) {
 	if (button == 'n' || button == 'N' || button == '\x0E') {
-	    midend_stop_anim(me);
 	    midend_new_game(me);
 	    midend_redraw(me);
 	    goto done;		       /* never animate */