]> granicus.if.org Git - nethack/commitdiff
fix segfault fix
authorPatR <rankin@nethack.org>
Mon, 6 Apr 2020 15:24:39 +0000 (08:24 -0700)
committerPatR <rankin@nethack.org>
Mon, 6 Apr 2020 15:24:39 +0000 (08:24 -0700)
Previous fix prevented getting skill feedback about bare-handed
combat/martial arts.

src/insight.c

index 9149ceece9305228ba57ea80d6c4a1419445f443..147ee9979d7ead25a0c7b91f23b2f1f51b08386f 100644 (file)
@@ -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);