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

Function stuff_prevents_passage

src/monmove.c:2318–2353  ·  view source on GitHub ↗

* Inventory prevents passage under door. * Used by can_ooze() and can_fog(). */

Source from the content-addressed store, hash-verified

2316 * Used by can_ooze() and can_fog().
2317 */
2318staticfn boolean
2319stuff_prevents_passage(struct monst *mtmp)
2320{
2321 struct obj *chain, *obj;
2322
2323 if (mtmp == &gy.youmonst) {
2324 chain = gi.invent;
2325 } else {
2326 chain = mtmp->minvent;
2327 }
2328 for (obj = chain; obj; obj = obj->nobj) {
2329 int typ = obj->otyp;
2330
2331 if (typ == COIN_CLASS && obj->quan > 100L)
2332 return TRUE;
2333 if (obj->oclass != GEM_CLASS && !(typ >= ARROW && typ <= BOOMERANG)
2334 && !(typ >= DAGGER && typ <= CRYSKNIFE) && typ != SLING
2335 && !is_cloak(obj) && typ != FEDORA && !is_gloves(obj)
2336 && typ != LEATHER_JACKET && typ != CREDIT_CARD && !is_shirt(obj)
2337 && !(typ == CORPSE && verysmall(&mons[obj->corpsenm]))
2338 && typ != FORTUNE_COOKIE && typ != CANDY_BAR && typ != PANCAKE
2339 && typ != LEMBAS_WAFER && typ != LUMP_OF_ROYAL_JELLY
2340 && obj->oclass != AMULET_CLASS && obj->oclass != RING_CLASS
2341 && obj->oclass != VENOM_CLASS && typ != SACK
2342 && typ != BAG_OF_HOLDING && typ != BAG_OF_TRICKS
2343 && !Is_candle(obj) && typ != OILSKIN_SACK && typ != LEASH
2344 && typ != STETHOSCOPE && typ != BLINDFOLD && typ != TOWEL
2345 && typ != TIN_WHISTLE && typ != MAGIC_WHISTLE
2346 && typ != MAGIC_MARKER && typ != TIN_OPENER && typ != SKELETON_KEY
2347 && typ != LOCK_PICK)
2348 return TRUE;
2349 if (Is_container(obj) && obj->cobj)
2350 return TRUE;
2351 }
2352 return FALSE;
2353}
2354
2355boolean
2356can_ooze(struct monst *mtmp)

Callers 2

can_oozeFunction · 0.85
can_fogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected