From 47a25c8abcb93d2209def6b2c2d5e3fc3870a249 Mon Sep 17 00:00:00 2001 From: Kestrel Gregorich-Trevor Date: Fri, 6 Oct 2023 13:15:00 -0500 Subject: [PATCH] Looking up custom fruitnames in the encyclopedia. Looking up a custom fruitname in the encyclopedia will now yield the encyclopedia entry for "fruit" if another matching database entry is not found. This preserves the fun associated with naming fruits after existing objects, while also preventing a failure to find. --- src/pager.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pager.c b/src/pager.c index cdee598ea..d115779dd 100644 --- a/src/pager.c +++ b/src/pager.c @@ -862,6 +862,12 @@ checkfile( if (alt && (ap = strstri(alt, " (")) != 0 && ap > alt) *ap = '\0'; + /* If the object's name matches the player-specified fruitname, + then "fruit" is the alternate description. We do this here so that + if the fruit name is an extant object, looking at the fruit yields + that object's description. */ + if (!alt && !strncmpi(dbase_str, gp.pl_fruit, PL_FSIZ)) + alt = strcpy(newstr, obj_descr[SLIME_MOLD].oc_name); /* * If the object is named, then the name is the alternate description; * otherwise, the result of makesingular() applied to the name is. @@ -869,7 +875,7 @@ checkfile( * user will usually be found under their name, rather than under * their object type, so looking for a singular form is pointless. */ - if (!alt) + else if (!alt) alt = makesingular(dbase_str); pass1found_in_file = FALSE;