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

Function nxt_unbypassed_loot

src/worn.c:1158–1174  ·  view source on GitHub ↗

like nxt_unbypassed_obj() but operates on sortloot_item array rather than an object linked list; the array contains obj==Null terminator; there's an added complication that the array may have stale pointers for deleted objects (see Multiple-Drop case in askchain(invent.c)) */

Source from the content-addressed store, hash-verified

1156 there's an added complication that the array may have stale pointers
1157 for deleted objects (see Multiple-Drop case in askchain(invent.c)) */
1158struct obj *
1159nxt_unbypassed_loot(Loot *lootarray, struct obj *listhead)
1160{
1161 struct obj *o, *obj;
1162
1163 while ((obj = lootarray->obj) != 0) {
1164 for (o = listhead; o; o = o->nobj)
1165 if (o == obj)
1166 break;
1167 if (o && !obj->bypass) {
1168 bypass_obj(obj);
1169 break;
1170 }
1171 ++lootarray;
1172 }
1173 return obj;
1174}
1175
1176void
1177mon_break_armor(struct monst *mon, boolean polyspot)

Callers 1

askchainFunction · 0.85

Calls 1

bypass_objFunction · 0.85

Tested by

no test coverage detected