]> granicus.if.org Git - nethack/commitdiff
m_useupall
authornethack.rankin <nethack.rankin>
Sun, 22 Apr 2007 02:42:35 +0000 (02:42 +0000)
committernethack.rankin <nethack.rankin>
Sun, 22 Apr 2007 02:42:35 +0000 (02:42 +0000)
     While updating discard_minvent I noticed that m_useupall is using
the wrong routine to get rid of a monster's weapon.  It probably doesn't
matter since I don't think monsters can use up items they're wielding or
wield items they could use up.

src/mthrowu.c

index 78513a334f6932adac80756fc35b95a2f042b1f8..a72c3ed65205881bc6706161de9e9eb08e6f364a 100644 (file)
@@ -452,8 +452,8 @@ struct monst *mon;
 struct obj *obj;
 {
        obj_extract_self(obj);
-       possibly_unwield(mon, FALSE);
        if (obj->owornmask) {
+           if (obj == MON_WEP(mon)) mwepgone(mon);
            mon->misc_worn_check &= ~obj->owornmask;
            update_mon_intrinsics(mon, obj, FALSE, FALSE);
            obj->owornmask = 0L;