From 516d428c40ebfeace120d6bffe5bdee57027f776 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 16 Dec 2023 06:39:26 -0500 Subject: [PATCH] update commented-out macro in artifact.c --- src/artifact.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/artifact.c b/src/artifact.c index 79e3f0e03..a63f6a0fd 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -17,7 +17,8 @@ static struct artifact *get_artifact(struct obj *) NONNULL; /* never returns null */ /* #define get_artifact(o) \ - (((o) && (o)->oartifact) ? &artilist[(int) (o)->oartifact] \ + (((o) && ((o)->artifact > 0 && (o)->artifact < AFTER_LAST_ARTIFACT)) \ + ? &artilist[(int) (o)->oartifact] \ : &artilist[ART_NONARTIFACT]) */ static boolean bane_applies(const struct artifact *, struct monst *) NONNULLARG12; @@ -2545,7 +2546,8 @@ is_art(struct obj *obj, int art) } /* #define get_artifact(o) \ - (((o) && (o)->oartifact) ? &artilist[(int) (o)->oartifact] \ + (((o) && ((o)->artifact > 0 && (o)->artifact < AFTER_LAST_ARTIFACT)) \ + ? &artilist[(int) (o)->oartifact] \ : &artilist[ART_NONARTIFACT]) */ static struct artifact *