Skip to content

Commit

Permalink
Use find_mid finding the leashed mon
Browse files Browse the repository at this point in the history
  • Loading branch information
paxed committed Feb 26, 2022
1 parent 020d3f7 commit d0f349c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/apply.c
Expand Up @@ -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;
Expand Down

0 comments on commit d0f349c

Please sign in to comment.