'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

@@ -318,8 +318,13 @@ NEARDATA extern coord bhitpos; /* place where throw or zap hits or stops */
#define BASICENLIGHTENMENT 1 /* show mundane stuff */
#define MAGICENLIGHTENMENT 2 /* show intrinsics and such */
#define ENL_GAMEINPROGRESS 0
#define ENL_GAMEOVERALIVE 1 /* ascension, escape, quit, trickery */
#define ENL_GAMEOVERDEAD 2
#define ENL_GAMEOVERALIVE 1 /* ascension, escape, quit, trickery */
#define ENL_GAMEOVERDEAD 2
/* control flags for sortloot() */
#define SORTLOOT_PACK 0x01
#define SORTLOOT_INVLET 0x02
#define SORTLOOT_LOOT 0x04
/* Macros for messages referring to hands, eyes, feet, etc... */
#define ARM 0