enchant weapon fix (trunk only)

Noticed while testing crysknives; a post-3.4.3 change (not present in
the branch code) introduced a bug that prevented scrolls of enchant weapon
from being used up properly when read.
This commit is contained in:
nethack.rankin
2006-12-19 05:24:59 +00:00
parent 5ce14e99fc
commit f4faab3f73

View File

@@ -166,9 +166,9 @@ doread()
else if (!objects[scroll->otyp].oc_uname)
docall(scroll);
}
scroll->in_use = FALSE;
if(scroll->otyp != SCR_BLANK_PAPER)
useup(scroll);
else scroll->in_use = FALSE;
}
return(1);
}
@@ -1078,10 +1078,10 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
uwep->oerodeproof = new_erodeproof ? 1 : 0;
break;
}
if (chwepon(sobj,
scursed ? -1 : !uwep ? 1 :
(uwep->spe >= 9) ? !rn2(uwep->spe) :
sblessed ? rnd(3 - uwep->spe / 3) : 1))
if (!chwepon(sobj,
scursed ? -1 : !uwep ? 1 :
(uwep->spe >= 9) ? !rn2(uwep->spe) :
sblessed ? rnd(3 - uwep->spe / 3) : 1))
sobj = 0; /* nothing enchanted: strange_feeling -> useup */
break;
case SCR_TAMING: