MCPcopy Create free account
hub / github.com/NetHack/NetHack / mleashed_next2u

Function mleashed_next2u

src/apply.c:890–914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

888}
889
890staticfn boolean
891mleashed_next2u(struct monst *mtmp)
892{
893 if (mtmp->mleashed) {
894 if (!m_next2u(mtmp))
895 mnexto(mtmp, RLOC_NOMSG);
896 if (!m_next2u(mtmp)) {
897 struct obj *otmp = get_mleash(mtmp);
898
899 if (!otmp) {
900 impossible("leashed-unleashed mon?");
901 return TRUE;
902 }
903
904 if (otmp->cursed)
905 return TRUE;
906 mtmp->mleashed = 0;
907 otmp->leashmon = 0;
908 update_inventory();
909 You_feel("%s leash go slack.",
910 (number_leashed() > 1) ? "a" : "the");
911 }
912 }
913 return FALSE;
914}
915
916#undef MAXLEASHED
917

Callers

nothing calls this directly

Calls 6

mnextoFunction · 0.85
get_mleashFunction · 0.85
update_inventoryFunction · 0.85
You_feelFunction · 0.85
number_leashedFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected