shithub: puzzles

Download patch

ref: a3c5409af26b5596c47a48a4b7e706d30da5da24
parent: 17f261018a9721e677cb43c74471f17ac9e3ac6e
author: Simon Tatham <anakin@pobox.com>
date: Fri Apr 30 06:17:22 EDT 2004

Keep the status bar in better sync with the game display.

[originally from svn r4177]

--- a/fifteen.c
+++ b/fifteen.c
@@ -554,6 +554,13 @@
     {
 	char statusbuf[256];
 
+        /*
+         * Don't show the new status until we're also showing the
+         * new _state_ - after the game animation is complete.
+         */
+        if (oldstate)
+            state = oldstate;
+
 	sprintf(statusbuf, "%sMoves: %d",
 		(state->completed ? "COMPLETED! " : ""),
 		(state->completed ? state->completed : state->movecount));
--- a/sixteen.c
+++ b/sixteen.c
@@ -599,6 +599,13 @@
     {
 	char statusbuf[256];
 
+        /*
+         * Don't show the new status until we're also showing the
+         * new _state_ - after the game animation is complete.
+         */
+        if (oldstate)
+            state = oldstate;
+
 	sprintf(statusbuf, "%sMoves: %d",
 		(state->completed ? "COMPLETED! " : ""),
 		(state->completed ? state->completed : state->movecount));