X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/9bb4a9a0f35f10b4341bb78140b9e916aeb3aa09..f10106138f70a92b276899d0822650cb2ec1adae:/rect.c diff --git a/rect.c b/rect.c index 318cde0..439ae1f 100644 --- a/rect.c +++ b/rect.c @@ -1348,6 +1348,8 @@ static char *new_game_desc(game_params *params, random_state *rs, r1.x++; r1.w--; break; + default: /* should never happen */ + assert(!"invalid direction"); } if (r1.h > 0 && r1.w > 0) place_rect(params2, grid, r1); @@ -2477,6 +2479,9 @@ static game_state *execute_move(game_state *from, char *move) vedge(ret,x1,y1) = !vedge(ret,x1,y1); } + sfree(ret->correct); + ret->correct = get_correct(ret); + /* * We've made a real change to the grid. Check to see * if the game has been completed. @@ -2494,9 +2499,6 @@ static game_state *execute_move(game_state *from, char *move) ret->completed = TRUE; } - sfree(ret->correct); - ret->correct = get_correct(ret); - return ret; }