ring discovery (trunk only)
Picking up and putting on a +1 ring of protection while blind
resulted in having a "+1 ring (on {left|right} hand)" in inventory and
having ring of protection show up in the discoveries list. The problem
is the same as the one for wands which has been previously addressed
(but not 100% fixed...): when using an item whose effect is observable,
the item's type became discovered based upon that observation even if the
item itself had never been seen.
The code for removing ring of protection lacked its break statement
and fell into the case for removing ring of protection from shapechangers,
but didn't cause any noticeable problem.
This commit is contained in:
28
src/attrib.c
28
src/attrib.c
@@ -900,6 +900,34 @@ acurrstr()
|
||||
else return((schar)(str - 100));
|
||||
}
|
||||
|
||||
/* when wearing (or taking off) an unID'd item, this routine is used
|
||||
to distinguish between observable +0 result and no-visible-effect
|
||||
due to an attribute not being able to exceed maximum or minimun */
|
||||
boolean
|
||||
extremeattr(attrindx) /* does attrindx's value match its max or min? */
|
||||
int attrindx;
|
||||
{
|
||||
/* Fixed_abil and racial MINATTR/MAXATTR aren't relevant here */
|
||||
int lolimit = 3, hilimit = 25, curval = ACURR(attrindx);
|
||||
|
||||
/* upper limit for Str is 25 but its value is encoded differently */
|
||||
if (attrindx == A_STR) {
|
||||
hilimit = STR19(25); /* 125 */
|
||||
/* lower limit for Str can also be 25 */
|
||||
if (uarmg && uarmg->otyp == GAUNTLETS_OF_POWER)
|
||||
lolimit = hilimit;
|
||||
}
|
||||
/* this exception is hypothetical; the only other worn item affecting
|
||||
Int or Wis is another helmet so can't be in use at the same time */
|
||||
if (attrindx == A_INT || attrindx == A_WIS) {
|
||||
if (uarmh && uarmh->otyp == DUNCE_CAP)
|
||||
hilimit = lolimit = 6;
|
||||
}
|
||||
|
||||
/* are we currently at either limit? */
|
||||
return (curval == lolimit || curval == hilimit) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
/* avoid possible problems with alignment overflow, and provide a centralized
|
||||
* location for any future alignment limits
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user