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;
|
int pass, lo_x, lo_y, hi_x, hi_y, k = 0;
|
||||||
|
|
||||||
(void) memset((genericptr_t) matching, 0, sizeof matching);
|
(void) memset((genericptr_t) matching, 0, sizeof matching);
|
||||||
for (sidx = 1; sidx < MAXPCHARS; sidx++) { /* [0] left as 0 */
|
for (sidx = 0; sidx < MAXPCHARS; sidx++) {
|
||||||
if (IS_DOOR(sidx) || IS_WALL(sidx)
|
/* don't even try to match some terrain: walls, room... */
|
||||||
|| sidx == SDOOR || sidx == SCORR
|
if (is_cmap_wall(sidx) || is_cmap_room(sidx)
|
||||||
|| glyph_to_cmap(k) == S_room
|
|| is_cmap_corr(sidx) || is_cmap_door(sidx)
|
||||||
|| glyph_to_cmap(k) == S_darkroom
|
|| sidx == S_ndoor)
|
||||||
|| glyph_to_cmap(k) == S_corr
|
|
||||||
|| glyph_to_cmap(k) == S_litcorr)
|
|
||||||
continue;
|
continue;
|
||||||
if (c == defsyms[sidx].sym
|
if (c == defsyms[sidx].sym
|
||||||
|| c == (int) g.showsyms[sidx]
|
|| c == (int) g.showsyms[sidx]
|
||||||
|
|||||||
@@ -942,6 +942,7 @@ cmap_to_type(int sym)
|
|||||||
typ = TREE;
|
typ = TREE;
|
||||||
break;
|
break;
|
||||||
case S_room:
|
case S_room:
|
||||||
|
case S_darkroom:
|
||||||
typ = ROOM;
|
typ = ROOM;
|
||||||
break;
|
break;
|
||||||
case S_corr:
|
case S_corr:
|
||||||
|
|||||||
Reference in New Issue
Block a user