diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 59a309b8e..c0cbdfff4 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -4,6 +4,8 @@ General Fixes and Modified Features ----------------------------------- fix "You hear The food ration tumbles downwards" for blinded pit dropping silver arrows weren't causing silver damage on some silver-haters when wielded +wizard mode: avoid division by 0 crash for level teleport in the endgame if + confusion overrides teleport control Platform- and/or Interface-Specific Fixes diff --git a/src/teleport.c b/src/teleport.c index 79e917830..99f344611 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)teleport.c 3.4 2003/12/01 */ +/* SCCS Id: @(#)teleport.c 3.4 2003/12/12 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1222,7 +1222,8 @@ random_teleport_level() int nlev, max_depth, min_depth, cur_depth = (int)depth(&u.uz); - if (!rn2(5) || Is_knox(&u.uz)) + /* [the endgame case can only occur in wizard mode] */ + if (!rn2(5) || Is_knox(&u.uz) || In_endgame(&u.uz)) return cur_depth; /* What I really want to do is as follows: