]> granicus.if.org Git - nethack/commit
fix #H7205, #H7120, #H5216 - sortloot
authorPatR <rankin@nethack.org>
Sun, 10 Jun 2018 01:03:37 +0000 (18:03 -0700)
committernhmall <nhmall@nethack.org>
Mon, 11 Jun 2018 20:31:58 +0000 (16:31 -0400)
commit77d478c9399a3faf4109056f316ee985faa88d91
treed8ef2c223b653d7fbe0fbe439a055dfeffde99ef
parent79515570572912dff759eb45da96b76670ad894e
fix #H7205, #H7120, #H5216 - sortloot

H7205 - full-pack identify might skip items if perm_invent is on
        because updating the inventory window might reorder 'invent'
        while the identify code is in the midst of traversing it;
H7120 - pickup that doesn't pick anything up can change the glyph
        shown on the map because the pile might be reordered such
        that a different item is on top;
H5216 - performing a sortloot operation on a pile and then switching
        back to sortloot:none doesn't restore pile's original order.

The 'revamp' that changed the contributed sortloot feature to switch
to simpler usage (object list itself was sorted rather than having a
parallel array that needed to be constructed, sorted, traversed, and
discarded) turns out to have too many problems.  This reverts to a
hybrid solution that constructs an array for traversal, leaving the
linked list in its original order, but hides most of the details of
that from sortloot() callers.  The 'revamp' benefit of being able to
use normal list traversal is lost, as is the potential to skip
sorting when the list turns out to already be in the desired order.

This could stand to have a lot more testing than it's had so far.
doc/fixes36.2
include/extern.h
include/hack.h
src/end.c
src/invent.c
src/pickup.c
src/worn.c