Skip to content

Commit

Permalink
charging scroll fix (trunk only)
Browse files Browse the repository at this point in the history
     A while back some code ended up in the wrong order, resulting in null
pointer dereference when reading a not-yet-discovered scroll of charging.
  • Loading branch information
nethack.rankin committed Jun 8, 2006
1 parent b41b903 commit d439b12
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -1179,15 +1179,15 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
break;
}
/* known = TRUE; -- handled inline here */
if (!already_known) {
pline("This is a charging scroll.");
learnscroll(sobj);
}
/* use it up now to prevent it from showing in the
getobj picklist because the "disappears" message
was already delivered */
useup(sobj);
sobj = 0; /* it's gone */
if (!already_known) {
pline("This is a charging scroll.");
learnscroll(sobj);
}
otmp = getobj(all_count, "charge");
if (otmp) recharge(otmp, scursed ? -1 : sblessed ? 1 : 0);
break;
Expand Down

0 comments on commit d439b12

Please sign in to comment.