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

Function dodrop

src/do.c:28–43  ·  view source on GitHub ↗

the #drop command: drop one inventory item */

Source from the content-addressed store, hash-verified

26
27/* the #drop command: drop one inventory item */
28int
29dodrop(void)
30{
31 int result;
32
33 if (*u.ushops)
34 sellobj_state(SELL_DELIBERATE);
35 result = drop(getobj("drop", any_obj_ok,
36 GETOBJ_PROMPT | GETOBJ_ALLOWCNT));
37 if (*u.ushops)
38 sellobj_state(SELL_NORMAL);
39 if (result)
40 reset_occupations();
41
42 return result;
43}
44
45/* Called when a boulder is dropped, thrown, or pushed. If it ends up
46 * in a pool, it either fills the pool up or sinks away. In either case,

Callers

nothing calls this directly

Calls 4

sellobj_stateFunction · 0.85
dropFunction · 0.85
getobjFunction · 0.85
reset_occupationsFunction · 0.85

Tested by

no test coverage detected