Encyclopedia lookup: check all existing fruitnames

Use fruit_from_name instead of checking gp.pl_fruit directly so that
changing the fruitname won't cause fruits already in the player's
inventory to stop working with lookup.
This commit is contained in:
Michael Meyer
2023-11-05 14:55:27 -08:00
committed by PatR
parent 6c8035d1e7
commit 6cfd3367bc
+1 -1
View File
@@ -897,7 +897,7 @@ checkfile(
then "fruit" is the alternate description. We do this here so that 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 if the fruit name is an extant object, looking at the fruit yields
that object's description. */ that object's description. */
if (!alt && !strncmpi(dbase_str, gp.pl_fruit, PL_FSIZ)) if (!alt && fruit_from_name(dbase_str, TRUE, (int *) 0))
alt = strcpy(newstr, obj_descr[SLIME_MOLD].oc_name); alt = strcpy(newstr, obj_descr[SLIME_MOLD].oc_name);
/* /*
* If the object is named, then the name is the alternate description; * If the object is named, then the name is the alternate description;