fix #K4088 and #K4089 - ring formatting
+/-N for charged rings with known enchantment was clobbering the
BUC formatting that had occurred earlier. #K4088 thought it was a
problem with the implicit_cursed option; followup #K4089 from same
user correctly pointed out that the problem was present for any BUC
state.
This is the same line of code that inadvertently omitted the space
between +/-N and "ring of <type>". That was fixed by commit
1a2b2a8cae a couple of days ago.
While in doname(), fix a potential issue calling corpse_xname().
That assigns a new value to gx.xnamep, clobbering the value that
doname() relied on when it was first called (but doesn't look at
again, so doesn't matter now but could conceivably in the future).
This commit is contained in:
@@ -1845,6 +1845,8 @@ stacked pair of potions of healing in supply chest weighed same as one potion;
|
||||
weight updated as their stack was split; if close to an encumbrance
|
||||
threshold, new weight would trigger an encumbrance increase message,
|
||||
immediately followed a decrease message when the potion got used up
|
||||
bounds checking for object name formatting inadvertently introduced a change
|
||||
that hid BUC prefix for charged rings
|
||||
|
||||
|
||||
Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository
|
||||
|
||||
16
src/objnam.c
16
src/objnam.c
@@ -1435,7 +1435,7 @@ doname_base(
|
||||
Concat(bp, 0, " (lit)");
|
||||
break;
|
||||
case RING_CLASS:
|
||||
ring:
|
||||
ring: /* normal rings reach here 'naturally'; meat ring jumps here */
|
||||
if (obj->owornmask & W_RINGR)
|
||||
Concat(bp, 0, " (on right ");
|
||||
if (obj->owornmask & W_RINGL)
|
||||
@@ -1443,7 +1443,7 @@ doname_base(
|
||||
if (obj->owornmask & W_RING) /* either left or right */
|
||||
ConcatF1(bp, 0,"%s)", body_part(HAND));
|
||||
if (known && objects[obj->otyp].oc_charged) {
|
||||
Sprintf(prefix, "%+d ", obj->spe); /* sitoa(obj->spe)+" " */
|
||||
Sprintf(eos(prefix), "%+d ", obj->spe); /* sitoa(obj->spe)+" " */
|
||||
}
|
||||
break;
|
||||
case FOOD_CLASS:
|
||||
@@ -1455,11 +1455,17 @@ doname_base(
|
||||
"corpse" is already in the buffer returned by xname() */
|
||||
unsigned cxarg = (((obj->quan != 1L) ? 0 : CXN_ARTICLE)
|
||||
| CXN_NOCORPSE);
|
||||
char *cxstr = corpse_xname(obj, prefix, cxarg);
|
||||
char *cxstr, *save_xnamep;
|
||||
|
||||
/* corpse_xname() sets xnamep; callers other than doname_base()
|
||||
itself shouldn't care about xnamep (pointer to start of
|
||||
current obuf[]) but keep it accurate anyway */
|
||||
save_xnamep = gx.xnamep;
|
||||
cxstr = corpse_xname(obj, prefix, cxarg);
|
||||
Sprintf(prefix, "%s ", cxstr);
|
||||
/* avoid having doname(corpse) consume an extra obuf */
|
||||
releaseobuf(cxstr);
|
||||
gx.xnamep = save_xnamep;
|
||||
} else if (obj->otyp == EGG) {
|
||||
#if 0 /* corpses don't tell if they're stale either */
|
||||
if (known && stale_egg(obj))
|
||||
@@ -1472,9 +1478,9 @@ doname_base(
|
||||
if (obj->spe == 1)
|
||||
Concat(bp, 0, " (laid by you)");
|
||||
}
|
||||
}
|
||||
if (obj->otyp == MEAT_RING)
|
||||
} else if (obj->otyp == MEAT_RING) {
|
||||
goto ring;
|
||||
}
|
||||
break;
|
||||
case BALL_CLASS:
|
||||
case CHAIN_CLASS:
|
||||
|
||||
Reference in New Issue
Block a user