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

Function bill_box_content

src/shk.c:3386–3407  ·  view source on GitHub ↗

recursive billing of objects within containers. */

Source from the content-addressed store, hash-verified

3384
3385/* recursive billing of objects within containers. */
3386staticfn void
3387bill_box_content(
3388 struct obj *obj,
3389 boolean ininv,
3390 boolean dummy,
3391 struct monst *shkp)
3392{
3393 struct obj *otmp;
3394
3395 if (SchroedingersBox(obj))
3396 return;
3397 for (otmp = obj->cobj; otmp; otmp = otmp->nobj) {
3398 if (otmp->oclass == COIN_CLASS)
3399 continue;
3400
3401 /* the "top" box is added in addtobill() */
3402 if (!otmp->no_charge)
3403 add_one_tobill(otmp, dummy, shkp);
3404 if (Has_contents(otmp))
3405 bill_box_content(otmp, ininv, dummy, shkp);
3406 }
3407}
3408
3409DISABLE_WARNING_FORMAT_NONLITERAL
3410

Callers 1

addtobillFunction · 0.85

Calls 1

add_one_tobillFunction · 0.85

Tested by

no test coverage detected