]> granicus.if.org Git - nethack/commit
#overview overhaul, part I (trunk only)
authornethack.rankin <nethack.rankin>
Thu, 2 Feb 2012 10:15:04 +0000 (10:15 +0000)
committernethack.rankin <nethack.rankin>
Thu, 2 Feb 2012 10:15:04 +0000 (10:15 +0000)
commita7aaee910e92bd7e9d59d437d15e852acc98b6af
treeac24013ae731965a22bb8a710591512b4d064ede
parent88b88e2ca5cc974e1f77628d4dcf586b66e84ebe
#overview overhaul, part I (trunk only)

     Reformat the DUNGEON_OVERVIEW code in dungeon.c.  It's clear from the
way lines were wrapping that the original author used an editor that let
him set tab expansion to columns of four, and when they're treated as the
conventional eight then some longish lines won't fit.  Switch to using a
mix of tabs and four spaces instead of all tab characters.

     I've separated out my more interesting changes (which will come later).
However, there are a bunch of minor ones included:
 1) the lastseentyp array is reused for each level visited, but it wasn't
    being reinitialized when creating a new level, so remembered fountains,
    altars, and so forth could be erroneously propogated across levels
    (the original contributed patch may not have suffered from this because
    it handled last-seen data differently than the code which is in place);
 2) add 3.5.0 health food store to the list of recognized shop types;
 3) make an #annotate value of a single space delete any old annotation
    without adding a new one, the way monster and object naming works;
 4) the code to discard overview data for a branch of the dungeon which
    can no longer be reached (quest expulsion) wasn't capable of doing so
    for the very first level (a hypothetical problem since level 1 isn't in
    the quest...) and didn't free memory used for user-supplied annotations;
 5) reorganize dooverview() where Michael's compiler reported that a
    variable might be used before being initialized (it wasn't, but it also
    wasn't even needed to achieve the intended result);
 6) redo the #overview formatting macros so that they'll work with pre-ANSI
    compilers that don't support concatenation of adjacent string literals;
 7) function-like macro ADDNTOBUF() was used without terminating semi-colon,
    which confused emacs when indenting, so this rewrites it such that it
    expects ordinary termination and will work correctly if ever used in the
    form 'if (some_condition) ADDNTOBUF(args); else ...';
 8) comment out water/ice/lava with #if 0 ... #endif rather than /* ... */.
src/dungeon.c