angband/angband — pull request #183 by pnd10 (2012-08-24 23:55:08+00:00)
Title: Fix for #1187

Correctly handle the case of chests in stacks, by pushing the check of trapped etc. down to a lower level, and iterating over all the possible chests in a stack.

Also rolled into this pullreq is a major refactoring of chests, pulling the code out of various places into src/object/chest.c, and encapsulating things, particularly the magic bit of knowledge that a positive pval is a trapped chest, a negative pval is the same disarmed, and a zero pval is an empty (i.e. opened) chest.