reinstate obj guard on _see_with_infrared macro

Checking the callers:
newsym() the use of see_with_infrared() is guarded by
    } else if ((mon = m_at(x, y)) != 0 [...]

do_mgivenname() the use of see_with_infrared is guarded by !mtmp:
        && (!mtmp
            || (!sensemon(mtmp)
                && (!(cansee(cx, cy) || see_with_infrared(mtmp))

howmonseen(mon) dereferences mon in other places, so it would
    segfault if mon were NULL; howmonseen has NONNULLARG1.
This commit is contained in:
nhmall
2023-12-16 12:55:09 -05:00
parent 294ce9b59d
commit caa8aa7f60
2 changed files with 2 additions and 1 deletions

View File

@@ -104,7 +104,7 @@
* canseemon() or canspotmon() which already check that.
*/
#define _see_with_infrared(mon) \
(!Blind && Infravision && mon && infravisible(mon->data) \
(!Blind && Infravision && infravisible(mon->data) \
&& couldsee(mon->mx, mon->my))
/*