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

Function container_at

src/pickup.c:2023–2038  ·  view source on GitHub ↗

Is there a container at x,y. Optional: return count of containers at x,y */

Source from the content-addressed store, hash-verified

2021
2022/* Is there a container at x,y. Optional: return count of containers at x,y */
2023int
2024container_at(coordxy x, coordxy y, boolean countem)
2025{
2026 struct obj *cobj, *nobj;
2027 int container_count = 0;
2028
2029 for (cobj = svl.level.objects[x][y]; cobj; cobj = nobj) {
2030 nobj = cobj->nexthere;
2031 if (Is_container(cobj)) {
2032 container_count++;
2033 if (!countem)
2034 break;
2035 }
2036 }
2037 return container_count;
2038}
2039
2040staticfn boolean
2041able_to_loot(

Callers 3

doopen_indirFunction · 0.85
doloot_coreFunction · 0.85
dotipFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected