getpos cmap vs glyph followup
This is a bit more efficient, since everything up to S_hcdoor is skipped anyway, but it's a little harder to understand so needs more comments. Not sure if it's worth it or not...
This commit is contained in:
@@ -926,10 +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 */
|
/* start the loop one past the block of doors, walls, etc,
|
||||||
/* don't even try to match some terrain: walls, room... */
|
because we aren't interested in trying to match them */
|
||||||
if (sidx <= S_hcdoor
|
for (sidx = S_hcdoor + 1; sidx < MAXPCHARS; sidx++) {
|
||||||
|| sidx == S_room || sidx == S_darkroom
|
/* some additional cmap types that should be skipped */
|
||||||
|
if (sidx == S_room || sidx == S_darkroom
|
||||||
|| sidx == S_corr || sidx == S_litcorr)
|
|| sidx == S_corr || sidx == S_litcorr)
|
||||||
continue;
|
continue;
|
||||||
if (c == defsyms[sidx].sym
|
if (c == defsyms[sidx].sym
|
||||||
|
|||||||
Reference in New Issue
Block a user