When some parts of getpos were rearranged in
7404597, tests of terrain
types and glyphs were moved to a loop which iterated through the defsyms
array without being updated to handle cmap values instead. Consequently
they weren't excluding certain terrain types from being 'jumped to' as
intended. (Though it seems as though they actually worked by chance to
some extent, just because there's some overlap between terrain types and
defsyms in terms of where the 'walls/doors' blocks start and end.)
I also noticed that cmap_to_type was missing S_darkroom (it fell through
to the default case so that the function returned STONE), so I added it.
(void) memset((genericptr_t) matching, 0, sizeof matching);
for (sidx = 1; sidx < MAXPCHARS; sidx++) { /* [0] left as 0 */
- if (IS_DOOR(sidx) || IS_WALL(sidx)
- || sidx == SDOOR || sidx == SCORR
- || glyph_to_cmap(k) == S_room
- || glyph_to_cmap(k) == S_darkroom
- || glyph_to_cmap(k) == S_corr
- || glyph_to_cmap(k) == S_litcorr)
+ /* don't even try to match some terrain: walls, room... */
+ if (sidx <= S_hcdoor
+ || sidx == S_room || sidx == S_darkroom
+ || sidx == S_corr || sidx == S_litcorr)
continue;
if (c == defsyms[sidx].sym
|| c == (int) g.showsyms[sidx]
typ = TREE;
break;
case S_room:
+ case S_darkroom:
typ = ROOM;
break;
case S_corr: