From 56f1201e4370658f4d2f9058af4e6e6ed5f0e6d0 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 1 Feb 2023 16:10:41 +0200 Subject: [PATCH] Use strchr, not index --- src/monmove.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/monmove.c b/src/monmove.c index 65a9121d6..0e70a2c62 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -859,10 +859,10 @@ mon_would_take_item(struct monst *mtmp, struct obj *otmp) if (likes_gems(mtmp->data) && otmp->oclass == GEM_CLASS && objects[otmp->otyp].oc_material != MINERAL && pctload < 85) return TRUE; - if (likes_objs(mtmp->data) && index(practical, otmp->oclass) + if (likes_objs(mtmp->data) && strchr(practical, otmp->oclass) && pctload < 75) return TRUE; - if (likes_magic(mtmp->data) && index(magical, otmp->oclass) + if (likes_magic(mtmp->data) && strchr(magical, otmp->oclass) && pctload < 85) return TRUE; if (throws_rocks(mtmp->data) && otmp->otyp == BOULDER