From feebb561d6920294434dc85de4f220b67308a815 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 7 Sep 2022 07:52:33 -0400 Subject: [PATCH] redundant comparison code watchman_canseeu() m_canseeu() already includes couldsee() so redundant code was flagged. : #define m_canseeu(m) \ : ((!Invis || perceives((m)->data)) \ : && !Underwater \ : && couldsee((m)->mx, (m)->my)) static boolean watchman_canseeu(struct monst *mtmp) { if (is_watch(mtmp->data) && mtmp->mcansee && m_canseeu(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mpeaceful) return TRUE; return FALSE; } --- src/dig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dig.c b/src/dig.c index 0e92c6019..1176bbdab 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1207,7 +1207,7 @@ static boolean watchman_canseeu(struct monst *mtmp) { if (is_watch(mtmp->data) && mtmp->mcansee && m_canseeu(mtmp) - && couldsee(mtmp->mx, mtmp->my) && mtmp->mpeaceful) + && mtmp->mpeaceful) return TRUE; return FALSE; }