#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
| 4978 | * Specifying a count to split it into two stacks is not allowed. |
| 4979 | */ |
| 4980 | int |
| 4981 | doorganize(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 */ |
| 5007 | int |
nothing calls this directly
no test coverage detected