fix issue #1469 - glitches with type-naming

Issue reported by ars3niy:  assigning names to types of objects,
or clearing such, did not update persistent inventory window.  Also,
the sequence
  assign-a-name,
  name-as-' '-to-unname,
  assign-a-name again,
  unname again
would result in impossible: "named object not in disco".

This fixes the impossibility.  The fix for #1470 has already taken
care of the presistent inventory issue.

Fixes #1469
This commit is contained in:
PatR
2025-12-09 17:24:33 -08:00
parent 7dc4512bb3
commit bc13a42ce3
2 changed files with 4 additions and 2 deletions

View File

@@ -2168,6 +2168,9 @@ livelog/#chronicle for bribing a demon lord reported random monster and
livelog/#chronicle for saving-grace: if saving-grace prevents hero's death,
report it [at present, it uses the livelog classification for breaking
a conduct]
naming a type of item, unnaming it (with name of <space>), naming it again
(new name or re-use of old one), then unnaming it again would issue
impossible: "named object not in disco"
Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository

View File

@@ -488,7 +488,7 @@ discover_object(
void
undiscover_object(int oindx)
{
if (!objects[oindx].oc_name_known) {
if (!objects[oindx].oc_name_known && !objects[oindx].oc_encountered) {
int dindx, acls = objects[oindx].oc_class;
boolean found = FALSE;
@@ -510,7 +510,6 @@ undiscover_object(int oindx)
if (objects[oindx].oc_class == GEM_CLASS)
gem_learned(oindx); /* ok, it's actually been unlearned */
update_inventory();
}
}