drain life vs drain resisting objects (trunk only)

From the newsgroup:  casting spell of drain life at Stormbringer
(or Excalibur or Staff of Aesculapius) would reduce its enchantment just
like any other weapon.  Drain resistance should protect against that even
when not actively wielded.
This commit is contained in:
nethack.rankin
2012-01-08 01:26:35 +00:00
parent e3648c2adc
commit 1563a3e0ec
2 changed files with 5 additions and 3 deletions

View File

@@ -1007,7 +1007,8 @@ register struct obj *obj;
obj->oclass != ARMOR_CLASS && !is_weptool(obj)) ||
obj->spe <= 0)
return (FALSE);
if (obj_resists(obj, 10, 90))
if (defends(AD_DRLI, obj) || defends_when_carried(AD_DRLI, obj) ||
obj_resists(obj, 10, 90))
return (FALSE);
/* Charge for the cost of the object */