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

Function doorganize

src/invent.c:4980–5004  ·  view source on GitHub ↗

#adjust command * * User specifies a 'from' slot for inventory stack to move, * then a 'to' slot for its destination. Open slots and those * filled by compatible stacks are listed as likely candidates * but user can pick any inventory letter (including 'from'). * * to == from, 'from' has a name * All compatible items (same name or no name) are gathered * in

Source from the content-addressed store, hash-verified

4978 * Specifying a count to split it into two stacks is not allowed.
4979 */
4980int
4981doorganize(void) /* inventory organizer by Del Lamb */
4982{
4983 int (*adjust_filter)(struct obj *);
4984 struct obj *obj;
4985
4986 /* when no invent, or just gold in '$' slot, there's nothing to adjust */
4987 if (!gi.invent || (gi.invent->oclass == COIN_CLASS
4988 && gi.invent->invlet == GOLD_SYM && !gi.invent->nobj)) {
4989 You("aren't carrying anything %s.",
4990 !gi.invent ? "to adjust" : "adjustable");
4991 return ECMD_OK;
4992 }
4993
4994 if (!flags.invlet_constant)
4995 reassign();
4996
4997 /* filter passed to getobj() depends upon gold sanity */
4998 adjust_filter = check_invent_gold("adjust") ? adjust_gold_ok : adjust_ok;
4999
5000 /* get object the user wants to organize (the 'from' slot) */
5001 obj = getobj("adjust", adjust_filter, GETOBJ_PROMPT | GETOBJ_ALLOWCNT);
5002
5003 return doorganize_core(obj);
5004}
5005
5006/* alternate version of #adjust used by itemactions() for splitting */
5007int

Callers

nothing calls this directly

Calls 5

YouFunction · 0.85
reassignFunction · 0.85
check_invent_goldFunction · 0.85
getobjFunction · 0.85
doorganize_coreFunction · 0.85

Tested by

no test coverage detected