'sortloot' revamp

Change the sortloot option to use qsort() instead of naive insertion
sort.  After sorting, it reorders the linked list into the sorted
order, so might have some subtle change(s) in behavior since that
wasn't done before.

pickup.c includes some formatting cleanup.

modified:
  include/extern.h, hack.h, obj.h
  src/do.c, do_wear.c, end.c, invent.c, pickup.c
This commit is contained in:
PatR
2016-03-13 16:23:38 -07:00
parent b89e0a832f
commit b3b4953020
8 changed files with 278 additions and 219 deletions

View File

@@ -813,8 +813,8 @@ int retry;
bypass_objlist(invent, FALSE);
} else {
/* should coordinate with perm invent, maybe not show worn items */
n = query_objlist("What would you like to drop?", invent,
USE_INVLET | INVORDER_SORT, &pick_list, PICK_ANY,
n = query_objlist("What would you like to drop?", &invent,
(USE_INVLET | INVORDER_SORT), &pick_list, PICK_ANY,
all_categories ? allow_all : allow_category);
if (n > 0) {
/*