dumplog revisions

I saw dumplog text in a newsgroup posting and the only way I could
recognize what version generated it was that "You entered the dungeon
N turns ago" included the missing-until-recently final period.  So,
put nethack's one-line version information as the very first dumplog
text and follow it with the dumped game's start and end date+time.
(That information is useful to know in its own right, but also should
prevent the build date+time shown with the version from confusing
anybody about when the dump was written.)

Along the way, I noticed that the 'counting' phase for artifact_score
was being repeated for '#if DUMPLOG' even though it doesn't generate
output.  That had a side-effect of adding points for artifacts twice
(applicable when final score was for an ascension or dungeon escape).
This commit is contained in:
PatR
2017-05-19 15:19:39 -07:00
parent 8964913f56
commit 365464d9a4
3 changed files with 54 additions and 35 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 windows.c $NHDT-Date: 1488075979 2017/02/26 02:26:19 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.39 $ */
/* NetHack 3.6 windows.c $NHDT-Date: 1495232365 2017/05/19 22:19:25 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.41 $ */
/* Copyright (c) D. Cohrs, 1993. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1033,7 +1033,7 @@ int behavior UNUSED, under UNUSED, over UNUSED;
#endif /* STATUS_VIA_WINDOWPORT */
STATIC_VAR struct window_procs dumplog_windowprocs_backup;
STATIC_PTR FILE *dumplog_file;
STATIC_VAR FILE *dumplog_file;
#ifdef DUMPLOG
STATIC_VAR time_t dumplog_now;
@@ -1152,8 +1152,8 @@ void
dump_close_log()
{
if (dumplog_file) {
fclose(dumplog_file);
dumplog_file = NULL;
(void) fclose(dumplog_file);
dumplog_file = (FILE *) 0;
}
}