Fix error marking scroll as used up
Forgot to change this when reorganizing the scroll effects into separate functions.
This commit is contained in:
+5
-5
@@ -1546,7 +1546,7 @@ seffect_charging(struct obj **sobjp)
|
|||||||
getobj picklist because the "disappears" message
|
getobj picklist because the "disappears" message
|
||||||
was already delivered */
|
was already delivered */
|
||||||
useup(sobj);
|
useup(sobj);
|
||||||
sobjp = 0; /* it's gone */
|
*sobjp = 0; /* it's gone */
|
||||||
otmp = getobj("charge", charge_ok, GETOBJ_PROMPT | GETOBJ_ALLOWCNT);
|
otmp = getobj("charge", charge_ok, GETOBJ_PROMPT | GETOBJ_ALLOWCNT);
|
||||||
if (otmp)
|
if (otmp)
|
||||||
recharge(otmp, scursed ? -1 : sblessed ? 1 : 0);
|
recharge(otmp, scursed ? -1 : sblessed ? 1 : 0);
|
||||||
@@ -1589,7 +1589,7 @@ seffect_fire(struct obj **sobjp)
|
|||||||
cval = bcsign(sobj);
|
cval = bcsign(sobj);
|
||||||
dam = (2 * (rn1(3, 3) + 2 * cval) + 1) / 3;
|
dam = (2 * (rn1(3, 3) + 2 * cval) + 1) / 3;
|
||||||
useup(sobj);
|
useup(sobj);
|
||||||
sobjp = 0; /* it's gone */
|
*sobjp = 0; /* it's gone */
|
||||||
if (!already_known)
|
if (!already_known)
|
||||||
(void) learnscrolltyp(SCR_FIRE);
|
(void) learnscrolltyp(SCR_FIRE);
|
||||||
if (confused) {
|
if (confused) {
|
||||||
@@ -1764,7 +1764,7 @@ seffect_gold_detection(struct obj **sobjp)
|
|||||||
boolean confused = (Confusion != 0);
|
boolean confused = (Confusion != 0);
|
||||||
|
|
||||||
if ((confused || scursed) ? trap_detect(sobj) : gold_detect(sobj))
|
if ((confused || scursed) ? trap_detect(sobj) : gold_detect(sobj))
|
||||||
sobjp = 0; /* failure: strange_feeling() -> useup() */
|
*sobjp = 0; /* failure: strange_feeling() -> useup() */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1773,7 +1773,7 @@ seffect_food_detection(struct obj **sobjp)
|
|||||||
struct obj *sobj = *sobjp;
|
struct obj *sobj = *sobjp;
|
||||||
|
|
||||||
if (food_detect(sobj))
|
if (food_detect(sobj))
|
||||||
sobjp = 0; /* nothing detected: strange_feeling -> useup */
|
*sobjp = 0; /* nothing detected: strange_feeling -> useup */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1793,7 +1793,7 @@ seffect_identify(struct obj **sobjp)
|
|||||||
/* use up the scroll first, before learnscrolltyp() -> makeknown()
|
/* use up the scroll first, before learnscrolltyp() -> makeknown()
|
||||||
performs perm_invent update; also simplifies empty invent check */
|
performs perm_invent update; also simplifies empty invent check */
|
||||||
useup(sobj);
|
useup(sobj);
|
||||||
sobjp = 0; /* it's gone */
|
*sobjp = 0; /* it's gone */
|
||||||
/* scroll just identifies itself for any scroll read while confused
|
/* scroll just identifies itself for any scroll read while confused
|
||||||
or for cursed scroll read without knowing identify yet */
|
or for cursed scroll read without knowing identify yet */
|
||||||
if (confused || (scursed && !already_known))
|
if (confused || (scursed && !already_known))
|
||||||
|
|||||||
Reference in New Issue
Block a user