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:
4
src/do.c
4
src/do.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user