From 58085dc9ba1f138006c50fbcce3eaa941a6d731e Mon Sep 17 00:00:00 2001 From: Erik Lunna Date: Fri, 20 Dec 2024 14:42:19 -0500 Subject: [PATCH] Fix: Could still wish for enchantment on potions. This is mostly a preventative measure to avoid impossibles for sanity errors - but practically it also prevents merging problems. --- src/objnam.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/objnam.c b/src/objnam.c index 27c1d9b30..62d74fcf1 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -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 */ @@ -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