X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/0e87eedc4e85f1e9f165fba059f001610bf4c42b..5b5c6b1255fb259a0aa0c33ad9ae46c46b86bc61:/cube.c diff --git a/cube.c b/cube.c index 45b38bc..d5221e6 100644 --- a/cube.c +++ b/cube.c @@ -1366,13 +1366,15 @@ void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate, draw_rect(fe, 0, 0, (int)((bb.r-bb.l+2.0F) * GRID_SCALE), (int)((bb.d-bb.u+2.0F) * GRID_SCALE), COL_BACKGROUND); - if (oldstate && oldstate->movecount > state->movecount) { + if (dir < 0) { game_state *t; /* * This is an Undo. So reverse the order of the states, and * run the roll timer backwards. */ + assert(oldstate); + t = oldstate; oldstate = state; state = t;