From d0f349cbd17b3b947bf9c1a5405d5eaa9484dacf Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 26 Feb 2022 22:42:37 +0200 Subject: [PATCH] Use find_mid finding the leashed mon --- src/apply.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/apply.c b/src/apply.c index 6ef88e89f5..9e8ef6bf1f 100644 --- a/src/apply.c +++ b/src/apply.c @@ -760,12 +760,7 @@ check_leash(xchar x, xchar y) for (otmp = g.invent; otmp; otmp = otmp->nobj) { if (otmp->otyp != LEASH || otmp->leashmon == 0) continue; - for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { - if (DEADMONSTER(mtmp)) - continue; - if ((int) mtmp->m_id == otmp->leashmon) - break; - } + mtmp = find_mid(otmp->leashmon, FM_FMON); if (!mtmp) { impossible("leash in use isn't attached to anything?"); otmp->leashmon = 0;