fix mysterious force bug

Subtracting one dungeon depth value from another had the subtraction
backwards and that yielded a negative value where a positive one is
expected.  If NH_RELEASE_STATUS were to be set to NH_STATUS_RELEASED
then this was at risk of crashing (if the bad subtraction yields -2,
rn2(diff+2) would divide by 0) since rn2()'s argument isn't validated
for released version.

fixes37.0 was confused, listing a couple of things that aren't bugs
in 3.6 as general fixes.  I suspect that the DLB one was fixed before
being exposed via git, so shouldn't be there at all.
This commit is contained in:
PatR
2019-12-22 17:22:07 -08:00
parent 6e136b19c4
commit e0c67f49fc
2 changed files with 8 additions and 6 deletions

View File

@@ -1,8 +1,7 @@
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.29 $ $NHDT-Date: 1577055058 2019/12/22 22:50:58 $
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.30 $ $NHDT-Date: 1577063925 2019/12/23 01:18:45 $
General Fixes and Modified Features
-----------------------------------
fix compile when DLB isn't defined
hero polymorphed into a vampire can use #monster to shape-shift rather than
just do a one-shot polymorph into bat/cloud/wolf and shifted vampire
hero can use #monster again to take on another form (randomly chosen
@@ -14,13 +13,16 @@ function calls made from mapglyph based on dungeon level are now called once
per level
fix accessing mons[-1] when trying to gate in a non-valid demon
fast hero could have random clairvoyance happen more than once on same turn
urealtime.realtime was being incorrectly calculated
using 'Q' on wielded weapon would offer to split stack; make using 'w' on a
quivered stack behave similarly
Fixes to Pre-3.7.0 Problems that Were Exposed Via git Repository
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
------------------------------------------------------------------
fix compile when DLB isn't defined
urealtime.realtime was being incorrectly calculated
revised "mysterious force" when climbing out of gehennom could generate
warnings about "rn2(0) attempted" or "rn2(-n) attempted"
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 do.c $NHDT-Date: 1576638499 2019/12/18 03:08:19 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.198 $ */
/* NetHack 3.6 do.c $NHDT-Date: 1577063925 2019/12/23 01:18:45 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.220 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1311,7 +1311,7 @@ boolean at_stairs, falling, portal;
if (diff != 0) {
assign_rnd_level(newlevel, &u.uz, diff);
/* assign_rnd_level() may have used a value less than diff */
diff = u.uz.dlevel - newlevel->dlevel; /* actual descent */
diff = newlevel->dlevel - u.uz.dlevel; /* actual descent */
/* if inside the tower, stay inside */
if (was_in_W_tower && !On_W_tower_level(newlevel))
diff = 0;