From 774129df114cf0a77379b1268083b8bdb42fd14e Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 4 Sep 2025 22:52:36 -0400 Subject: [PATCH] another #1441 follow-up bit --- include/extern.h | 1 + src/uhitm.c | 7 +++++++ src/zap.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/extern.h b/include/extern.h index 3fffc7ab8..739880db5 100644 --- a/include/extern.h +++ b/include/extern.h @@ -3410,6 +3410,7 @@ extern void passive_obj(struct monst *, struct obj *, struct attack *) NONNULLAR extern void that_is_a_mimic(struct monst *, unsigned) NONNULLARG1; extern void stumble_onto_mimic(struct monst *) NONNULLARG1; extern boolean mimic_disguised_as_non_mon(struct monst *) NONNULLARG1; +extern boolean mimic_disguised_as_mon(struct monst *) NONNULLARG1; extern int flash_hits_mon(struct monst *, struct obj *) NONNULLARG12; extern void light_hits_gremlin(struct monst *, int) NONNULLARG1; diff --git a/src/uhitm.c b/src/uhitm.c index 3e1b3a7d4..090275cb3 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -6267,6 +6267,13 @@ mimic_disguised_as_non_mon(struct monst *mtmp) && M_AP_TYPE(mtmp) != M_AP_MONSTER); } +boolean +mimic_disguised_as_mon(struct monst *mtmp) +{ + return (M_AP_TYPE(mtmp) + && M_AP_TYPE(mtmp) == M_AP_MONSTER); +} + staticfn void nohandglow(struct monst *mon) { diff --git a/src/zap.c b/src/zap.c index f7001d2ac..7cceffba3 100644 --- a/src/zap.c +++ b/src/zap.c @@ -192,7 +192,7 @@ bhitm(struct monst *mtmp, struct obj *otmp) reveal_invis = TRUE; learn_it = cansee(gb.bhitpos.x, gb.bhitpos.y); if (resists_magm(mtmp)) { /* match effect on player */ - if (mimic_disguised_as_non_mon(mtmp)) + if (!mimic_disguised_as_mon(mtmp)) seemimic(mtmp); shieldeff(mtmp->mx, mtmp->my); pline("Boing!");