From c59b7bf11b5fa7cea516f63da0615d8fe7d23072 Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 4 Nov 2017 16:04:46 -0700 Subject: [PATCH] fix #H6391 - artifact #invoke for charging Latent bug: if a non-role-specific artifact which could be invoked for charging existed, it would never work as if blessed because the test for no-role was wrong. Caused when 3.3.0 changed the Role_if() predicate and artilist[] array to use monster index numbers (PM_foo) instead of role letters; the non-role value changed from '\0' to NON_PM (-1) but the test for non-role didn't. No fixes36.1 entry; there aren't any artifacts which were affected. --- src/artifact.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/artifact.c b/src/artifact.c index 25fc17118..a7678551a 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 artifact.c $NHDT-Date: 1451081581 2015/12/25 22:13:01 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.99 $ */ +/* NetHack 3.6 artifact.c $NHDT-Date: 1509836679 2017/11/04 23:04:39 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.106 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1496,8 +1496,8 @@ struct obj *obj; obj->age = 0; return 0; } - b_effect = (obj->blessed - && (Role_switch == oart->role || !oart->role)); + b_effect = (obj->blessed && (oart->role == Role_switch + || oart->role == NON_PM)); recharge(otmp, b_effect ? 1 : obj->cursed ? -1 : 0); update_inventory(); break;