another artifact.c tweak

Use 'AFTER_LAST_ARTIFACT instead of SIZE(artilist)
This commit is contained in:
nhmall
2023-12-16 08:34:09 -05:00
parent 91fdc1104a
commit 3eed55471b

View File

@@ -2555,7 +2555,9 @@ get_artifact(struct obj *obj)
int artidx = (int) obj->oartifact;
/* skip 0, 1st artifact at 1 */
if (artidx > 0 && artidx < SIZE(artilist))
/* SIZE(artilist) would include the terminator,
so use AFTER_LAST_ARTIFACT instead */
if (artidx > 0 && artidx < AFTER_LAST_ARTIFACT)
return &artilist[artidx];
}
return &artilist[ART_NONARTIFACT];