From c360822c89a48158dc303e5fedfd4db870870509 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 4 Jul 2023 23:17:30 -0700 Subject: [PATCH] github PR #1052 - levltyp[] re-synchronization Pull request from entrez: the legend for wizard mode #terrain wasn't updated to include terrain type "lava wall", so the entries for it and everything that followed were inaccurate. I've expanded the comment about level type codes in rm.h. Closes #1052 --- doc/fixes3-7-0.txt | 5 +++++ include/rm.h | 25 +++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 66088200c..79af17a36 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1214,6 +1214,11 @@ make potion of water become discovered if dipping a carried container into an a monster which was temporarily asleep wouldn't be affected by taming (either food or magic), but one that was indefinitely asleep would be; when tamable via food, it even caught and ate the food without waking up +in wizard mode, #terrain has offers to view all map locations as single- + letter codes corresponding to the levl[][].typ numbers and to view + a legend showing letter-to-type correspondence; adding new type + "lava wall" didn't update that legend and misdescribed all the types + which have higher values Fixes to 3.7.0-x General Problems Exposed Via git Repository diff --git a/include/rm.h b/include/rm.h index 1ee55cbcc..3b4ac2253 100644 --- a/include/rm.h +++ b/include/rm.h @@ -31,10 +31,27 @@ * +- -+- -+ | */ -/* Level location types. [Some debugging code in src/display.c - defines array type_names[] which contains an entry for each of - these, so needs to be kept in sync if any new types are added - or existing ones renumbered.] */ +/* + * Level location types, values for 'level.locations[x][y].typ'. + * + * These are different from display symbols and while there is + * similarity between the cmap subset of those, there isn't any + * one-to-one correspondence between the two encodings. For instance, + * the DOOR type has multiple symbols (closed|open|gone); so does the + * STAIRS type (down|up). Conversely, DRAWBRIDGE_UP represents the + * location of the projected span if the drawbridge were down but + * there is no symbol for that; it is displayed as water, ice, lava, or + * floor depending on what is at that spot when the bridge is 'closed'. + * + * [Some debugging code in src/display.c defines array type_names[] + * which contains an entry for each of these, so needs to be kept in + * sync if any new types are added or existing ones renumbered. The + * #terrain command also has a menu choice to display each map spot by + * a letter derived from these numeric values and another choice to + * display a legend showing the letter-to-type correspondence. If any + * types are added, removed, or reordered, that needs to be updated to + * keep in synch.] + */ enum levl_typ_types { STONE = 0, VWALL = 1,