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

Function m_useup

src/mthrowu.c:1161–1170  ·  view source on GitHub ↗

remove one instance of an item from a monster's inventory */

Source from the content-addressed store, hash-verified

1159
1160/* remove one instance of an item from a monster's inventory */
1161void
1162m_useup(struct monst *mon, struct obj *obj)
1163{
1164 if (obj->quan > 1L) {
1165 obj->quan--;
1166 obj->owt = weight(obj);
1167 } else {
1168 m_useupall(mon, obj);
1169 }
1170}
1171
1172/* monster attempts ranged weapon attack against player */
1173void

Callers 14

mhitm_ad_dgstFunction · 0.85
gulpumFunction · 0.85
mon_break_armorFunction · 0.85
lifesaved_monsterFunction · 0.85
reviveFunction · 0.85
zhitmFunction · 0.85
dobuzzFunction · 0.85
maybe_destroy_itemFunction · 0.85
precheckFunction · 0.85
use_defensiveFunction · 0.85
use_offensiveFunction · 0.85
use_miscFunction · 0.85

Calls 2

weightFunction · 0.85
m_useupallFunction · 0.85

Tested by

no test coverage detected