Prevent illegal positions for tmp_at
It seems like m_throw() can call tmp_at() with !isok coordinates, so prevent those in both functions
This commit is contained in:
@@ -900,6 +900,7 @@ tmp_at(x, y)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default: /* do it */
|
default: /* do it */
|
||||||
|
if (!isok(x,y)) break;
|
||||||
if (tglyph->style == DISP_BEAM || tglyph->style == DISP_ALL) {
|
if (tglyph->style == DISP_BEAM || tglyph->style == DISP_ALL) {
|
||||||
if (tglyph->style != DISP_ALL && !cansee(x,y)) break;
|
if (tglyph->style != DISP_ALL && !cansee(x,y)) break;
|
||||||
if (tglyph->sidx >= TMP_AT_MAX_GLYPHS) break; /* too many locations */
|
if (tglyph->sidx >= TMP_AT_MAX_GLYPHS) break; /* too many locations */
|
||||||
|
|||||||
@@ -440,7 +440,7 @@ struct obj *obj; /* missile (or stack providing it) */
|
|||||||
tmp_at(bhitpos.x, bhitpos.y);
|
tmp_at(bhitpos.x, bhitpos.y);
|
||||||
delay_output();
|
delay_output();
|
||||||
}
|
}
|
||||||
tmp_at(bhitpos.x, bhitpos.y);
|
if (isok(bhitpos.x, bhitpos.y)) tmp_at(bhitpos.x, bhitpos.y);
|
||||||
delay_output();
|
delay_output();
|
||||||
tmp_at(DISP_END, 0);
|
tmp_at(DISP_END, 0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user