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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user