X-Git-Url: https://plomlompom.com/repos/index.html?a=blobdiff_plain;f=src%2Fmain.c;h=693f204d9f785d6034e765a33c1a5eb173bbee95;hb=c330529615cc0c5f6772d7e342bc1c442e1f3519;hp=b65108b7b4ec4ae3b3a2c93e52a3490ab8fa068f;hpb=cd1ac671dae035da349e97983f9d65d5c0d7b2a9;p=plomrogue
diff --git a/src/main.c b/src/main.c
index b65108b..693f204 100644
--- a/src/main.c
+++ b/src/main.c
@@ -50,7 +50,7 @@ int main (int argc, char *argv[]) {
player.pos.x = read_uint16_bigendian(file) - 1;
player.hitpoints = fgetc(file);
read_map_objects (&world.monster, file, sizeof(struct Monster), read_map_objects_monsterdata);
- read_map_objects (&world.item, file, sizeof(struct Item), readwrite_map_objects_dummy);
+ read_map_objects (&world.item, file, sizeof(struct Item), NULL);
fclose(file); }
// For non-interactive mode, try to load world state from record file.
@@ -135,7 +135,7 @@ int main (int argc, char *argv[]) {
else
quit_called = meta_keys(key, &world, &win_meta, &win_keys, &win_map, &win_info, &win_log);
if (1 == quit_called)
- break; } }
+ exit_game(&world, &map); } }
// Interactive mode.
else {
@@ -161,14 +161,4 @@ int main (int argc, char *argv[]) {
else
quit_called = meta_keys(key, &world, &win_meta, &win_keys, &win_map, &win_info, &win_log);
if (1 == quit_called)
- break; } }
-
- // Clean up and exit.
- free(map.cells);
- for (key = 0; key <= world.keyswindata->max; key++)
- free(world.keybindings[key].name);
- free(world.keybindings);
- free(world.keyswindata);
- free(world.log);
- endwin();
- return 0; }
+ exit_game(&world, &map); } } }