home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Moved game exiting into its own function.
[plomrogue]
/
src
/
main.c
diff --git
a/src/main.c
b/src/main.c
index a720191eeeba8106485e6d77a6f9866fcab97a9e..693f204d9f785d6034e765a33c1a5eb173bbee95 100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-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)
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 {
// 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)
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); } } }