| 3018 | * containers. |
| 3019 | */ |
| 3020 | staticfn struct obj * |
| 3021 | find_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 | |
| 3043 | void |
| 3044 | free_pickinv_cache(void) |