Skip to content

Commit

Permalink
Fix: useup bug from being able to detect gems with scrolls of gold de…
Browse files Browse the repository at this point in the history
…tection.
  • Loading branch information
elunna committed Sep 23, 2023
1 parent 2b720a0 commit eb31744
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -2238,16 +2238,18 @@ struct obj *sobj; /* sobj - scroll or fake spellbook for spell */
break;
case SCR_GOLD_DETECTION: {
boolean failure;
if (!sobj)
break;
if (confused || scursed) {
failure = trap_detect(sobj, TRUE) != 0;
} else {
failure = gold_detect(sobj) != 0;
if (sobj->blessed && (object_detect(sobj, GEM_CLASS) == 0))
if (!failure && sobj && sobj->blessed
&& (object_detect(sobj, GEM_CLASS) == 0))
failure = FALSE;
}
if (failure) {
sobj = 0; /* failure: strange_feeling() -> useup() */
useup(sobj);
}
break;
}
Expand Down

0 comments on commit eb31744

Please sign in to comment.