MCPcopy Index your code
hub / github.com/NetHack/NetHack / useup

Function useup

src/invent.c:1320–1333  ·  view source on GitHub ↗

an item in inventory is going away after being used */

Source from the content-addressed store, hash-verified

1318
1319/* an item in inventory is going away after being used */
1320void
1321useup(struct obj *obj)
1322{
1323 /* Note: This works correctly for containers because they (containers)
1324 don't merge. */
1325 if (obj->quan > 1L) {
1326 obj->in_use = FALSE; /* no longer in use */
1327 obj->quan--;
1328 obj->owt = weight(obj);
1329 update_inventory();
1330 } else {
1331 useupall(obj);
1332 }
1333}
1334
1335/* use one charge from an item and possibly incur shop debt for it */
1336void

Callers 15

doneFunction · 0.85
dodrinkFunction · 0.85
dopotionFunction · 0.85
strange_feelingFunction · 0.85
dodipFunction · 0.85
poofFunction · 0.85
potion_dipFunction · 0.85
use_crystal_ballFunction · 0.85
Amulet_onFunction · 0.85
wornarm_destroyedFunction · 0.85
hmon_hitmon_misc_objFunction · 0.85

Calls 3

weightFunction · 0.85
update_inventoryFunction · 0.85
useupallFunction · 0.85

Tested by

no test coverage detected