diff rogue4/main.c @ 26:ea7372f5d314

rogue4: add logging all games
author edwarj4
date Thu, 26 Nov 2009 03:02:13 +0000
parents 63b9fd7d70ce
children 09da55b986ca
line wrap: on
line diff
--- a/rogue4/main.c	Tue Nov 24 13:04:43 2009 +0000
+++ b/rogue4/main.c	Thu Nov 26 03:02:13 2009 +0000
@@ -108,6 +108,7 @@
     /*
      * check for print-score option
      */
+    open_log(); /* do first, open_score might drop needed permissions */
     open_score();
     if (argc == 2 && strcmp(argv[1], "-s") == 0)
     {
@@ -349,6 +350,7 @@
 	mvprintw(LINES - 2, 0, "You quit with %d gold pieces", purse);
 	move(LINES - 1, 0);
 	refresh();
+	writelog(purse, 1, 0);
 	score(purse, 1);
 	exit(0);
     }