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

Function count_target_containers

src/pickup.c:3848–3864  ·  view source on GitHub ↗

returns number of containers in object chain; does not recurse into containers; skips bags of tricks when they're known */

Source from the content-addressed store, hash-verified

3846/* returns number of containers in object chain; does not recurse into
3847 containers; skips bags of tricks when they're known */
3848staticfn int
3849count_target_containers(
3850 struct obj *olist, /* list of objects (invent) */
3851 struct obj *excludo) /* particular object to exclude if found in list */
3852{
3853 int ret = 0;
3854
3855 while (olist) {
3856 if (olist != excludo && Is_container(olist)
3857 /* include bag of tricks when not known to be such */
3858 && (box->otyp != BAG_OF_TRICKS || !box->dknown
3859 || !objects[box->otyp].oc_name_known))
3860 ret++;
3861 olist = olist->nobj;
3862 }
3863 return ret;
3864}
3865#endif
3866
3867/* ask user for a carried container into which they want box to be emptied;

Callers 1

tipcontainer_gettargetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected