Match object description via single function

making the code more readable.

Instead of doing strcmp(OBJ_DESCR(objects[otyp]), "foo"),
just call objdescr_is(obj, "foo")

(via xNetHack)
This commit is contained in:
Pasi Kallinen
2020-10-20 19:19:54 +03:00
parent 5880da9269
commit 566dde8683
10 changed files with 42 additions and 30 deletions

View File

@@ -1114,7 +1114,7 @@ struct monst *mtmp;
distant_name(otmp, doname));
/* give this one even if !verbose */
if (otmp->oclass == SCROLL_CLASS
&& !strcmpi(OBJ_DESCR(objects[otmp->otyp]), "YUM YUM"))
&& objdescr_is(otmp, "YUM YUM"))
pline("Yum%c", otmp->blessed ? '!' : '.');
} else {
if (flags.verbose)