Another getpos cmap followup
Hot on the heels of my previous commit, here's a way to do it without any assumptions about the order of defsyms.
This commit is contained in:
@@ -926,12 +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);
|
||||||
/* start the loop one past the block of doors, walls, etc,
|
for (sidx = 0; sidx < MAXPCHARS; sidx++) {
|
||||||
because we aren't interested in trying to match them */
|
/* don't even try to match some terrain: walls, room... */
|
||||||
for (sidx = S_hcdoor + 1; sidx < MAXPCHARS; sidx++) {
|
if (is_cmap_wall(sidx) || is_cmap_room(sidx)
|
||||||
/* some additional cmap types that should be skipped */
|
|| is_cmap_corr(sidx) || is_cmap_door(sidx)
|
||||||
if (sidx == S_room || sidx == S_darkroom
|
|| sidx == S_ndoor)
|
||||||
|| sidx == S_corr || sidx == S_litcorr)
|
|
||||||
continue;
|
continue;
|
||||||
if (c == defsyms[sidx].sym
|
if (c == defsyms[sidx].sym
|
||||||
|| c == (int) g.showsyms[sidx]
|
|| c == (int) g.showsyms[sidx]
|
||||||
|
|||||||
Reference in New Issue
Block a user