Skip to content

Commit

Permalink
Fix: Could still wish for enchantment on potions.
Browse files Browse the repository at this point in the history
This is mostly a preventative measure to avoid impossibles for sanity errors - but practically it also prevents merging problems.
  • Loading branch information
elunna committed Dec 20, 2024
1 parent 7781404 commit 58085dc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/objnam.c
Original file line number Diff line number Diff line change
Expand Up @@ -4420,6 +4420,7 @@ readobjnam_parse_charges(struct _readobjnam_data *d)
d->spesgn = -1; /* cheaters get what they deserve */
d->spe = abs(d->spe);
}

/* cap on obj->spe is independent of (and less than) SCHAR_LIM */
if (d->spe > SPE_LIM)
d->spe = SPE_LIM; /* slime mold uses d.ftype, so not affected */
Expand Down Expand Up @@ -5216,7 +5217,11 @@ readobjnam(char *bp, struct obj *no_wish)
&& d.spe != 0) {
d.spe = 0;
}


/* For sanity... */
if (d.oclass == POTION_CLASS)
d.spe = 0;

/* if asking for corpse of a monster which leaves behind a glob, give
glob instead of rejecting the monster type to create random corpse */
if (d.typ == CORPSE && d.mntmp >= LOW_PM
Expand Down

0 comments on commit 58085dc

Please sign in to comment.