From 3eed55471bd6cefa058732132a4ca25e7717bede Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 16 Dec 2023 08:34:09 -0500 Subject: [PATCH] another artifact.c tweak Use 'AFTER_LAST_ARTIFACT instead of SIZE(artilist) --- src/artifact.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/artifact.c b/src/artifact.c index 282f7e511..79e3f0e03 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -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];