X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fmisc.c;h=cb650a0436b648cfd61c6f3bcb810bcd4a6044e8;hb=83d75731b23c1e7acda3d9d72bcf22fef49315be;hp=cff42644ca1abe26ff8f9d4997a03d542aa46168;hpb=2e690e2500e66535018bb6e01222442c074cb298;p=plomrogue diff --git a/src/misc.c b/src/misc.c index cff4264..cb650a0 100644 --- a/src/misc.c +++ b/src/misc.c @@ -10,6 +10,18 @@ #include "main.h" #include "yx_uint16.h" +extern void exit_game(struct World * world, struct Map * map) { +// Clean up and exit. + endwin(); + free(map->cells); + uint16_t key; + for (key = 0; key <= world->keyswindata->max; key++) + free(world->keybindings[key].name); + free(world->keybindings); + free(world->keyswindata); + free(world->log); + exit (EXIT_SUCCESS); } + extern void textfile_sizes (FILE * file, uint16_t * linemax_p, uint16_t * n_lines_p) { // Learn largest line length (linemax_p) and (n_lines_p if not set to NULL) number of lines. uint16_t n_lines = 0;