Show stinking cloud valid positions

This commit is contained in:
Pasi Kallinen
2015-04-05 13:47:59 +03:00
parent 056565fe75
commit 2643a5c311
3 changed files with 41 additions and 7 deletions

View File

@@ -829,8 +829,10 @@ shieldeff(x,y)
* DISP_ALWAYS- Like DISP_FLASH, but vision is not taken into account.
*/
#define TMP_AT_MAX_GLYPHS (COLNO*2)
static struct tmp_glyph {
coord saved[COLNO]; /* previously updated positions */
coord saved[TMP_AT_MAX_GLYPHS]; /* previously updated positions */
int sidx; /* index of next unused slot in saved[] */
int style; /* either DISP_BEAM or DISP_FLASH or DISP_ALWAYS */
int glyph; /* glyph to use when printing */
@@ -900,7 +902,7 @@ tmp_at(x, y)
default: /* do it */
if (tglyph->style == DISP_BEAM || tglyph->style == DISP_ALL) {
if (tglyph->style != DISP_ALL && !cansee(x,y)) break;
if (tglyph->sidx >= COLNO) break; /* too many locations */
if (tglyph->sidx >= TMP_AT_MAX_GLYPHS) break; /* too many locations */
/* save pos for later erasing */
tglyph->saved[tglyph->sidx].x = x;
tglyph->saved[tglyph->sidx].y = y;