]> granicus.if.org Git - nethack/commit
fix #H3013 - grammar bug with named fruit
authorPatR <rankin@nethack.org>
Wed, 5 Jul 2017 01:44:03 +0000 (18:44 -0700)
committerPatR <rankin@nethack.org>
Wed, 5 Jul 2017 01:44:03 +0000 (18:44 -0700)
commita573134d7e037b6896fef574d5ef04e06c28856a
treeb3e0649b1a56aff548512d8f011f9e2e15addda2
parent7a8559a34d238ccfd44f44f5dadbd11c1d0bec58
fix #H3013 - grammar bug with named fruit

Reported nearly four years ago for 3.4.3, original subject was
\#H3013: NetHack grammar bug when taking unpaid fruit from chest

Player used OPTIONS=fruit:Quorn and the capitalized value confuses
the() into thinking it's a proper name which shouldn't be preceded
by an article, resulting in "Quorn will cost you N zorkmids" when
removing it from a chest in a shop, followed by "X - a Quorn (unpaid)"
as it went into inventory.  It is a product name, but when used as a
fruit it shouldn't be treated as a proper name.  (Quorn is a meat
substitute rather than anything related to fruit.)  Teach the() about
named-fruits, so that we'll get "The Quorn will cost you N zorkmids."

Unfortunately, it means that someone who names their fruit after a
proper name used by the program, for example Mjollnir, can probably
induce other poorly worded messages (about the item rather than the
named-fruit).  the() is used all over the place and all it has to work
with is text, not the object whose formatted name produced that text.

I looked through a bunch of old cvs log messages last night, and
spotted one I wrote (in objnam.c) a dozen years ago where I suggested
forcing named-fruit values into lower case as they're being set up.
I don't remember that, but if we'd done it, this bug would have been
avoided.
src/objnam.c