artifact fruit

Reported by entrez:  when fruit name is given the name of an artifact
that doesn't use "the" at the start of its name, messages about the
artifact could be altered.  Example was fruit=Excalibur causing usual
 |You are blased by Excalibur's power!
to unintentionally change to
 |You are blased by the Excalibur's power!
because of a false match during special handling for named fruit in
function the().

This fixes that, and also changes basic inventory formatting.  Former
 |f - an Excalibur
will now be
 |f - Excalibur
for a fruit that has been assigned that name.  When sort pack in On,
as it is by default, that will be listed under Comestibles rather than
under Weapons so really shouldn't fool anyone.  And
 |f - 2 Excaliburs
also breaks the illusion.

This formatting change only affects named fruits.  User assigned names
for object types or for individual objects behave the same as before.
This commit is contained in:
PatR
2021-11-24 17:17:40 -08:00
parent 341d1dff13
commit 01b2bcff75
3 changed files with 34 additions and 11 deletions

View File

@@ -219,7 +219,8 @@ artifact_name(const char *name, short *otyp)
if (!strncmpi(aname, "the ", 4))
aname += 4;
if (!strcmpi(name, aname)) {
*otyp = a->otyp;
if (otyp)
*otyp = a->otyp;
return a->name;
}
}