]> granicus.if.org Git - nethack/commit
wizard mode ^V crash in endgame
authornethack.rankin <nethack.rankin>
Sat, 13 Dec 2003 14:51:38 +0000 (14:51 +0000)
committernethack.rankin <nethack.rankin>
Sat, 13 Dec 2003 14:51:38 +0000 (14:51 +0000)
commit41d3ad8c4e374144d8e8dc0d38fa040139c1fdfe
tree6f7306a83f0fb1e60bd6685d038458e866b3a407
parent86428dc1726dd5466562265c5a05042b582aeadc
wizard mode ^V crash in endgame

     Mentioned in passing in the newsgroup:  level teleporting in the
endgame--which is only possible in wizard mode--can crash if you're
confused.  The change to make confusion sometimes override teleport
control means that sometimes a random destination will be chosen, and
the routine to choose a random level can call rn2() with a value less
than 1 in the endgame, possibly resulting in attempt to divide by 0.

     There's something fishy about the min_/max_depth stuff for the
endgame, but I haven't attempted to figure that out.  This just makes
the random destination always be the current level when in the endgame
so that the problem can't come up.
doc/fixes34.4
src/teleport.c