]> granicus.if.org Git - nethack/commitdiff
disappearing scroll trick
authornethack.allison <nethack.allison>
Sat, 25 Feb 2006 00:43:39 +0000 (00:43 +0000)
committernethack.allison <nethack.allison>
Sat, 25 Feb 2006 00:43:39 +0000 (00:43 +0000)
<email deleted>
> * When you read a charging scroll, it "disappears", but when you are
> selecting the object to charge, the scroll itself remains in your
> inventory listing until you make your selection.

doc/fixes34.4
src/read.c

index ae47cf1980ead0ed98673dd95096cf0241621957..b16b1aac29017ea010162ecfebe7b7225ee4bdf1 100644 (file)
@@ -198,6 +198,8 @@ more precise probing/stethoscope feedback when engulfed
 make baby long worms have lower level than full grown ones
 use "your kraken" instead of "a kraken" when searching reveals a tame
        hidden monster
+prevent scroll of charging that has already disappeared from showing in the
+       picklist of things to charge
 
 
 Platform- and/or Interface-Specific Fixes
index 2119d682116786e7cc41ca97bb97d6f70b98c77b..922f60b149777db73abeacacaf9c25306e9cc7c7 100644 (file)
@@ -1154,10 +1154,13 @@ struct obj *sobj;
                known = TRUE;
                if (!already_known)
                    pline("This is a charging scroll.");
+               /* use it up now to prevent if from showing in the
+                  getobj picklist because the "disappears" message
+                  was already delivered */
+               useup(sobj);
                otmp = getobj(all_count, "charge");
-               if (!otmp) break;
-               recharge(otmp, scursed ? -1 : sblessed ? 1 : 0);
-               break;
+               if (otmp) recharge(otmp, scursed ? -1 : sblessed ? 1 : 0);
+               return(1);
        case SCR_MAGIC_MAPPING:
                if (level.flags.nommap) {
                    Your("mind is filled with crazy lines!");