pull request #823 - getpos confusion
Pull request from entrez: typing map symbols during a getpos operation was using incorrect values and might end up moving the cursor to walls or other terrain that it classifies as uninteresting and intends to ignore. Fixes #823
This commit is contained in:
@@ -926,13 +926,11 @@ getpos(coord *ccp, boolean force, const char *goal)
|
||||
int pass, lo_x, lo_y, hi_x, hi_y, k = 0;
|
||||
|
||||
(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)
|
||||
for (sidx = 0; sidx < MAXPCHARS; sidx++) {
|
||||
/* don't even try to match some terrain: walls, room... */
|
||||
if (is_cmap_wall(sidx) || is_cmap_room(sidx)
|
||||
|| is_cmap_corr(sidx) || is_cmap_door(sidx)
|
||||
|| sidx == S_ndoor)
|
||||
continue;
|
||||
if (c == defsyms[sidx].sym
|
||||
|| c == (int) g.showsyms[sidx]
|
||||
|
||||
@@ -942,6 +942,7 @@ cmap_to_type(int sym)
|
||||
typ = TREE;
|
||||
break;
|
||||
case S_room:
|
||||
case S_darkroom:
|
||||
typ = ROOM;
|
||||
break;
|
||||
case S_corr:
|
||||
|
||||
Reference in New Issue
Block a user