]> granicus.if.org Git - nethack/commitdiff
Use strchr, not index
authorPasi Kallinen <paxed@alt.org>
Wed, 1 Feb 2023 14:10:41 +0000 (16:10 +0200)
committerPasi Kallinen <paxed@alt.org>
Wed, 1 Feb 2023 14:10:41 +0000 (16:10 +0200)
src/monmove.c

index 65a9121d670055a19447bae57754588aefe4fa9d..0e70a2c62ee7031493f729db1d2e9dc9ef8a8d67 100644 (file)
@@ -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