fix bz157, #H4075 - 'realtime' had strange units

A couple of reports asked what weird unit of measure was used for the
'realtime' value in xlogfile.  It was just seconds, but was accumulating
incorrectly whenever game-state got saved for the checkpoint option.
Now it really is seconds, or rather whatever unit you get for the delta
of two time_t values; usually seconds but not guaranteed to be that.
This commit is contained in:
PatR
2015-12-15 17:59:42 -08:00
parent d17fcf3e13
commit 8f96d4b9ef
7 changed files with 29 additions and 33 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 restore.c $NHDT-Date: 1446892455 2015/11/07 10:34:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.101 $ */
/* NetHack 3.6 restore.c $NHDT-Date: 1450231174 2015/12/16 01:59:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.102 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -568,13 +568,10 @@ unsigned int *stuckid, *steedid;
foo = time_from_yyyymmddhhmmss(timebuf);
ReadTimebuf(ubirthday);
mread(fd, &urealtime.realtime, sizeof(urealtime.realtime));
ReadTimebuf(urealtime.restored);
#if defined(BSD) && !defined(POSIX_TYPES)
(void) time((long *) &urealtime.restored);
#else
(void) time(&urealtime.restored);
#endif
mread(fd, &urealtime.realtime, sizeof urealtime.realtime);
ReadTimebuf(urealtime.start_timing); /** [not used] **/
/* current time is the time to use for next urealtime.realtime update */
urealtime.start_timing = getnow();
set_uasmon();
#ifdef CLIPPING