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

Function reset_oattached_mids

src/restore.c:1509–1530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1507}
1508
1509staticfn void
1510reset_oattached_mids(boolean ghostly)
1511{
1512 struct obj *otmp;
1513 unsigned oldid, nid;
1514
1515 for (otmp = fobj; otmp; otmp = otmp->nobj) {
1516 if (ghostly && has_omonst(otmp)) {
1517 struct monst *mtmp = OMONST(otmp);
1518
1519 mtmp->m_id = 0;
1520 mtmp->mpeaceful = mtmp->mtame = 0; /* pet's owner died! */
1521 }
1522 if (ghostly && has_omid(otmp)) {
1523 oldid = OMID(otmp);
1524 if (lookup_id_mapping(oldid, &nid))
1525 OMID(otmp) = nid;
1526 else
1527 free_omid(otmp);
1528 }
1529 }
1530}
1531
1532#ifdef SELECTSAVED
1533/* put up a menu listing each character from this player's saved games;

Callers 1

getlevFunction · 0.85

Calls 2

lookup_id_mappingFunction · 0.85
free_omidFunction · 0.70

Tested by

no test coverage detected