setmnotwielded should always MON_NOWEP

Instead of making the caller remember to use MON_NOWEP, make
setmnotwielded handle that automatically.  This fixes the
"bad monster weapon restore" errors I've been seeing.

Also adds sanity checks for this.
This commit is contained in:
Pasi Kallinen
2015-10-06 18:47:52 +03:00
parent a51531776d
commit 8212ddd69e
5 changed files with 15 additions and 14 deletions

View File

@@ -282,10 +282,8 @@ struct obj *obj; /* missile (or stack providing it) */
/* not possibly_unwield, which checks the object's */
/* location, not its existence */
if (MON_WEP(mon) == obj) {
if (MON_WEP(mon) == obj)
setmnotwielded(mon, obj);
MON_NOWEP(mon);
}
obj_extract_self(obj);
singleobj = obj;
obj = (struct obj *) 0;