return legal indexes for some display.h macros
Some static analyzers flagged the last-resort values as out of bounds (which they were). There's a small number of other complaint-suppression items in here too, but nothing drastic.
This commit is contained in:
@@ -3161,13 +3161,12 @@ static boolean
|
||||
find_poleable_mon(coord *pos, int min_range, int max_range)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
coord mpos;
|
||||
coord mpos = { 0, 0 }; /* no candidate location yet */
|
||||
boolean impaired;
|
||||
coordxy x, y, lo_x, hi_x, lo_y, hi_y, rt;
|
||||
int glyph;
|
||||
|
||||
impaired = (Confusion || Stunned || Hallucination);
|
||||
mpos.x = mpos.y = 0; /* no candidate location yet */
|
||||
rt = isqrt(max_range);
|
||||
lo_x = max(u.ux - rt, 1), hi_x = min(u.ux + rt, COLNO - 1);
|
||||
lo_y = max(u.uy - rt, 0), hi_y = min(u.uy + rt, ROWNO - 1);
|
||||
|
||||
Reference in New Issue
Block a user