From: PatR Date: Mon, 6 Apr 2020 15:24:39 +0000 (-0700) Subject: fix segfault fix X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=995fde037c1c2d655f96f7260919ba650b7bd8b7;p=nethack fix segfault fix Previous fix prevented getting skill feedback about bare-handed combat/martial arts. --- diff --git a/src/insight.c b/src/insight.c index 9149ceece..147ee9979 100644 --- a/src/insight.c +++ b/src/insight.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 insight.c $NHDT-Date: 1586179508 2020/04/06 13:25:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.9 $ */ +/* NetHack 3.7 insight.c $NHDT-Date: 1586186430 2020/04/06 15:20:30 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.11 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1077,7 +1077,7 @@ int final; * Skill with current weapon. Might help players who've never * noticed #enhance or decided that it was pointless. */ - if (uwep && (wtype = weapon_type(uwep)) != P_NONE && !is_ammo(uwep)) { + if ((wtype = weapon_type(uwep)) != P_NONE && (!uwep || !is_ammo(uwep))) { char sklvlbuf[20]; int sklvl = P_SKILL(wtype); boolean hav = (sklvl != P_UNSKILLED && sklvl != P_SKILLED);