Skip to content

Commit

Permalink
Fix: rknown ID of glass armor, other item classes
Browse files Browse the repository at this point in the history
not_fully_identified wasn't updated to account for the fact that glass
items, nontraditional classes like scrolls and rings, and various other
previously-impossible targets can now be fooproofed with confused
enchant weapon.  Make sure the function is updated to reflect the types
of items where rknown matters, so that you can formally learn their
oerodeproof status.
  • Loading branch information
entrez committed Oct 21, 2021
1 parent 8f27145 commit 7c0b8ba
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/objnam.c
Original file line number Diff line number Diff line change
Expand Up @@ -1449,19 +1449,13 @@ not_fully_identified(struct obj* otmp)
if (otmp->oartifact && undiscovered_artifact(otmp->oartifact))
return TRUE;
/* otmp->rknown is the only item of interest if we reach here */
/*
* Note: if a revision ever allows scrolls to become fireproof or
* rings to become shockproof, this checking will need to be revised.
* `rknown' ID only matters if xname() will provide the info about it.
*/
if (otmp->rknown
|| (otmp->oclass != ARMOR_CLASS && otmp->oclass != WEAPON_CLASS
&& !is_weptool(otmp) /* (redundant) */
&& otmp->oclass != BALL_CLASS)) /* (useless) */
|| (!erosion_matters(otmp) && !destroyable_oclass(otmp->oclass)))
return FALSE;
else /* lack of `rknown' only matters for vulnerable objects */
return (boolean) (is_rustprone(otmp) || is_corrodeable(otmp)
|| is_flammable(otmp));
return (boolean) (is_damageable(otmp)
|| destroyable_oclass(otmp->oclass)
|| otmp->material == GLASS);
}

/* format a corpse name (xname() omits monster type; doname() calls us);
Expand Down

0 comments on commit 7c0b8ba

Please sign in to comment.