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

Function find_unpaid

src/invent.c:3020–3041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3018 * containers.
3019 */
3020staticfn struct obj *
3021find_unpaid(struct obj *list, struct obj **last_found)
3022{
3023 struct obj *obj;
3024
3025 while (list) {
3026 if (list->unpaid) {
3027 if (*last_found) {
3028 /* still looking for previous unpaid object */
3029 if (list == *last_found)
3030 *last_found = (struct obj *) 0;
3031 } else
3032 return ((*last_found = list));
3033 }
3034 if (Has_contents(list)) {
3035 if ((obj = find_unpaid(list->cobj, last_found)) != 0)
3036 return obj;
3037 }
3038 list = list->nobj;
3039 }
3040 return (struct obj *) 0;
3041}
3042
3043void
3044free_pickinv_cache(void)

Callers 1

dounpaidFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected