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

Function doddrop

src/do.c:923–944  ·  view source on GitHub ↗

the #droptype command: drop several things */

Source from the content-addressed store, hash-verified

921
922/* the #droptype command: drop several things */
923int
924doddrop(void)
925{
926 int result = ECMD_OK;
927
928 if (!gi.invent) {
929 You("have nothing to drop.");
930 return ECMD_OK;
931 }
932 add_valid_menu_class(0); /* clear any classes already there */
933 if (*u.ushops)
934 sellobj_state(SELL_DELIBERATE);
935 if (flags.menu_style != MENU_TRADITIONAL
936 || (result = ggetobj("drop", drop, 0, FALSE, (unsigned *) 0)) < -1)
937 result = menu_drop(result);
938 if (*u.ushops)
939 sellobj_state(SELL_NORMAL);
940 if (result)
941 reset_occupations();
942
943 return result;
944}
945
946staticfn boolean
947better_not_try_to_drop_that(struct obj *otmp)

Callers

nothing calls this directly

Calls 6

YouFunction · 0.85
add_valid_menu_classFunction · 0.85
sellobj_stateFunction · 0.85
ggetobjFunction · 0.85
menu_dropFunction · 0.85
reset_occupationsFunction · 0.85

Tested by

no test coverage detected