diff options
Diffstat (limited to 'emcc.c')
| -rw-r--r-- | emcc.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -309,6 +309,15 @@ static void update_permalinks(void) sfree(seed); } +/* + * Callback from the midend if Mines supersedes its game description, + * so we can update the permalinks. + */ +static void desc_changed(void *ignored) +{ + update_permalinks(); +} + /* ---------------------------------------------------------------------- * Implementation of the drawing API by calling Javascript canvas * drawing functions. (Well, half of it; the other half is on the JS @@ -762,6 +771,13 @@ int main(int argc, char **argv) } /* + * Request notification if a puzzle (hopefully only ever Mines) + * supersedes its game description, so that we can proactively + * update the permalink. + */ + midend_request_desc_changes(me, desc_changed, NULL); + + /* * Draw the puzzle's initial state, and set up the permalinks and * undo/redo greying out. */ |