fix #H5486 - artifact naming vs illiterate

Attempting to name the relevant type of item with an artifact's name
(such as a runesword with "Stormbringer") fails with "your hand
slips" in order to prevent turning the item into an aritfact.  Since
that only happens when the name is valid, it indicates that the hero
is literate so violate illiterate conduct.

(Naming items in general doesn't affect [il]literacy so that player
can assign names to inventory or stash items to maintain notes.)
This commit is contained in:
PatR
2017-05-22 16:02:50 -07:00
parent ead698fd02
commit 28fb985757
2 changed files with 6 additions and 1 deletions

View File

@@ -427,6 +427,8 @@ when configured with DUMPLOG enabled, artifacts were counted twice towards
once Moloch's Sanctum (or Astral Plane via wizard mode level teleport direct
to end-game) was entered, end of game disclosure would reveal that
high priests had been incorrectly flagged as extinct
attempting to name an item as an artifact and failing via hand slip violates
illiterate conduct
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 do_name.c $NHDT-Date: 1489494376 2017/03/14 12:26:16 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.116 $ */
/* NetHack 3.6 do_name.c $NHDT-Date: 1495494156 2017/05/22 23:02:36 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.118 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1081,6 +1081,9 @@ register struct obj *obj;
pline("While engraving, your %s slips.", body_part(HAND));
display_nhwindow(WIN_MESSAGE, FALSE);
You("engrave: \"%s\".", buf);
/* violate illiteracy conduct since hero attempted to write
a valid artifact name */
u.uconduct.literate++;
}
++via_naming; /* This ought to be an argument rather than a static... */
obj = oname(obj, buf);