Use find_mid finding the leashed mon
This commit is contained in:
+1
-6
@@ -760,12 +760,7 @@ check_leash(xchar x, xchar y)
|
|||||||
for (otmp = g.invent; otmp; otmp = otmp->nobj) {
|
for (otmp = g.invent; otmp; otmp = otmp->nobj) {
|
||||||
if (otmp->otyp != LEASH || otmp->leashmon == 0)
|
if (otmp->otyp != LEASH || otmp->leashmon == 0)
|
||||||
continue;
|
continue;
|
||||||
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
mtmp = find_mid(otmp->leashmon, FM_FMON);
|
||||||
if (DEADMONSTER(mtmp))
|
|
||||||
continue;
|
|
||||||
if ((int) mtmp->m_id == otmp->leashmon)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (!mtmp) {
|
if (!mtmp) {
|
||||||
impossible("leash in use isn't attached to anything?");
|
impossible("leash in use isn't attached to anything?");
|
||||||
otmp->leashmon = 0;
|
otmp->leashmon = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user