X-Git-Url: https://plomlompom.com/repos/test.html?a=blobdiff_plain;f=src%2Fmisc.c;h=cb650a0436b648cfd61c6f3bcb810bcd4a6044e8;hb=c330529615cc0c5f6772d7e342bc1c442e1f3519;hp=cff42644ca1abe26ff8f9d4997a03d542aa46168;hpb=726ded2374ea84340846cabf68640764d43aed86;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;