comparison 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
comparison
equal deleted inserted replaced
25:00e90f1bffd6 26:ea7372f5d314
106 strcpy(fruit, "slime-mold"); 106 strcpy(fruit, "slime-mold");
107 107
108 /* 108 /*
109 * check for print-score option 109 * check for print-score option
110 */ 110 */
111 open_log(); /* do first, open_score might drop needed permissions */
111 open_score(); 112 open_score();
112 if (argc == 2 && strcmp(argv[1], "-s") == 0) 113 if (argc == 2 && strcmp(argv[1], "-s") == 0)
113 { 114 {
114 noscore = TRUE; 115 noscore = TRUE;
115 score(0, -1); 116 score(0, -1);
347 signal(SIGINT, leave); 348 signal(SIGINT, leave);
348 clear(); 349 clear();
349 mvprintw(LINES - 2, 0, "You quit with %d gold pieces", purse); 350 mvprintw(LINES - 2, 0, "You quit with %d gold pieces", purse);
350 move(LINES - 1, 0); 351 move(LINES - 1, 0);
351 refresh(); 352 refresh();
353 writelog(purse, 1, 0);
352 score(purse, 1); 354 score(purse, 1);
353 exit(0); 355 exit(0);
354 } 356 }
355 else 357 else
356 { 358 {