urealtime.realtime was being calculated incorrectly

Looks like a merge gone awry perhaps.

Fixes #270
This commit is contained in:
nhmall
2019-12-22 17:23:18 -05:00
10 changed files with 89 additions and 34 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 allmain.c $NHDT-Date: 1555552624 2019/04/18 01:57:04 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.100 $ */
/* NetHack 3.6 allmain.c $NHDT-Date: 1577050218 2019/12/22 21:30:18 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.136 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -66,6 +66,10 @@ boolean resuming;
g.context.rndencode = rnd(9000);
set_wear((struct obj *) 0); /* for side-effects of starting gear */
(void) pickup(1); /* autopickup at initial location */
/* only matters if someday a character is able to start with
clairvoyance (wizard with cornuthaum perhaps?); without this,
first "random" occurrence would always kick in on turn 1 */
g.context.seer_turn = (long) rnd(30);
}
g.context.botlx = TRUE; /* for STATUS_HILITES */
update_inventory(); /* for perm_invent */
@@ -336,9 +340,21 @@ boolean resuming;
#endif
if (g.context.bypasses)
clear_bypasses();
if ((u.uhave.amulet || Clairvoyant) && !In_endgame(&u.uz)
&& !BClairvoyant && !(g.moves % 15) && !rn2(2))
do_vicinity_map((struct obj *) 0);
if (g.moves >= g.context.seer_turn) {
if ((u.uhave.amulet || Clairvoyant) && !In_endgame(&u.uz)
&& !BClairvoyant)
do_vicinity_map((struct obj *) 0);
/* we maintain this counter even when clairvoyance isn't
taking place; on average, go again 30 turns from now */
g.context.seer_turn = g.moves + (long) rn1(31, 15); /*15..45*/
/* [it used to be that on every 15th turn, there was a 50%
chance of farsight, so it could happen as often as every
15 turns or theoretically never happen at all; but when
a fast hero got multiple moves on that 15th turn, it
could actually happen more than once on the same turn!] */
}
/* [fast hero who gets multiple moves per turn ends up sinking
multiple times per turn; is that what we really want?] */
if (u.utrap && u.utraptype == TT_LAVA)
sink_into_lava();
/* when/if hero escapes from lava, he can't just stay there */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 detect.c $NHDT-Date: 1575245054 2019/12/02 00:04:14 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.100 $ */
/* NetHack 3.6 detect.c $NHDT-Date: 1577050472 2019/12/22 21:34:32 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.110 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1314,7 +1314,8 @@ struct obj *sobj; /* scroll--actually fake spellbook--object */
/* fake spellbook 'sobj' implies hero has cast the spell;
when book is blessed, casting is skilled or expert level;
if already clairvoyant, non-skilled spell acts like skilled */
extended = (sobj && (sobj->blessed || Clairvoyant));
extended = (sobj && (sobj->blessed || Clairvoyant)),
random_farsight = !sobj;
int newglyph, oldglyph,
lo_y = ((u.uy - 5 < 0) ? 0 : u.uy - 5),
hi_y = ((u.uy + 6 >= ROWNO) ? ROWNO - 1 : u.uy + 6),
@@ -1391,7 +1392,18 @@ struct obj *sobj; /* scroll--actually fake spellbook--object */
}
}
if (!g.level.flags.hero_memory || unconstrained || mdetected || odetected) {
/* when this instance of clairvoyance is random (see allmain()) and
the only reason to browse the map is that previously undetected
monster(s) or object(s) have been revealed, player can prevent
the you-sense-your-surroundings message and browse operation from
happening by setting 'quick_farsight' option; for clairvoyance
spell, that option is ignored because the message and the pause
for map browsing isn't as intrusive in that circumstance */
if (random_farsight && flags.quick_farsight)
mdetected = odetected = FALSE;
if (!g.level.flags.hero_memory || unconstrained
|| mdetected || odetected) {
flush_screen(1); /* flush temp screen */
/* the getpos() prompt from browse_map() is only shown when
flags.verbose is set, but make this unconditional so that

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 options.c $NHDT-Date: 1575245078 2019/12/02 00:04:38 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.391 $ */
/* NetHack 3.7 options.c $NHDT-Date: 1577050473 2019/12/22 21:34:33 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.422 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2008. */
/* NetHack may be freely redistributed. See license for details. */
@@ -184,6 +184,7 @@ static const struct Bool_Opt {
{ "popup_dialog", &iflags.wc_popup_dialog, FALSE, SET_IN_GAME }, /*WC*/
{ "preload_tiles", &iflags.wc_preload_tiles, TRUE, DISP_IN_GAME }, /*WC*/
{ "pushweapon", &flags.pushweapon, FALSE, SET_IN_GAME },
{ "quick_farsight", &flags.quick_farsight, FALSE, SET_IN_GAME },
#if defined(MICRO) && !defined(AMIGA)
{ "rawio", &iflags.rawio, FALSE, DISP_IN_GAME },
#else