From 5d690ae073c951d0b529020c6fb0fd285016a5fe Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 23 Aug 2008 01:17:41 +0000 Subject: [PATCH] force fruit name to be singular (trunk only) Inventory formatting for a single slime mold object would be strange if the user entered a plural word or phrase for fruit name. Forcing the user-specified value to be singular as it's being set up as current fruit avoids that. [Something like 's "bunch of grapes" is unaffected; it's already singular and correctly handled as such by makesingular().] This may have a side-effect of limiting the creativity of some players who try to trick others via bones files gimickery, but I think the extra consistency in object naming during ordinary play is worth it. According to the cvs log info, this issue was actually mentioned in a patch I made ("fix M203...") in October, 2005. I have no recollection of that at all.... --- doc/fixes35.0 | 3 +-- src/options.c | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index c910f95ea..2c6b4fd92 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -94,8 +94,7 @@ mind flayer brain eating is subject to certain fatal targets and to cannibalism mind flayer can't eat brains of ghost or shade corpses of unique monsters in bones behaved incorrectly if revived or eaten fix pluralization for "this tin smells like mother-in-laws" when hallucinating -try harder to keep pluralization straight when user assigns an already plural - value for named fruit +force user-specified fruit name to be singular avoid false matches when looking up fruit names ("grapefruit" isn't "grape") handle pluralization of man-at-arms and singularization of men-at-arms assigning an artifact name is rejected on objects with similar description to diff --git a/src/options.c b/src/options.c index 94e872846..7371a8ecd 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)options.c 3.5 2008/07/20 */ +/* SCCS Id: @(#)options.c 3.5 2008/08/22 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1629,8 +1629,10 @@ goodfruit: /* OBJ_NAME(objects[SLIME_MOLD]) won't work after initialization */ if (!*pl_fruit) nmcpy(pl_fruit, "slime mold", PL_FSIZ); - if (!initial) + if (!initial) { (void)fruitadd(pl_fruit); + pline("Fruit is now \"%s\".", pl_fruit); + } /* If initial, then initoptions is allowed to do it instead * of here (initoptions always has to do it even if there's * no fruit option at all. Also, we don't want people @@ -1638,6 +1640,7 @@ goodfruit: */ return; } + fullname = "warnings"; if (match_optname(opts, fullname, 5, TRUE)) { if (duplicate) complain_about_duplicate(opts,1); @@ -4052,10 +4055,16 @@ char *str; * a bones level... */ - /* Note: every fruit has an id (spe for fruit objects) of at least - * 1; 0 is an error. + /* Note: every fruit has an id (kept in obj->spe) of at least 1; + * 0 is an error. */ if (user_specified) { + /* force fruit to be singular; this handling is not + needed--or wanted--for fruits from bones because + they already received it in their original game */ + nmcpy(pl_fruit, makesingular(str), PL_FSIZ); + /* assert( str == pl_fruit ); */ + /* disallow naming after other foods (since it'd be impossible * to tell the difference) */