From b36d79233464cf4b6dbb0461db39ce5d303ae473 Mon Sep 17 00:00:00 2001 From: SHIRAKATA Kentaro Date: Sun, 21 Aug 2022 21:22:43 +0900 Subject: [PATCH] remove unnecessary null-check on bhitm() `otmp` here is always non-null, otherwise it leads segv at earlier code. --- src/zap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zap.c b/src/zap.c index 0a66af4da..70040128e 100644 --- a/src/zap.c +++ b/src/zap.c @@ -163,7 +163,7 @@ bhitm(struct monst *mtmp, struct obj *otmp) reveal_invis = FALSE; gn.notonhead = (mtmp->mx != gb.bhitpos.x || mtmp->my != gb.bhitpos.y); - skilled_spell = (otmp && otmp->oclass == SPBOOK_CLASS && otmp->blessed); + skilled_spell = (otmp->oclass == SPBOOK_CLASS && otmp->blessed); switch (otyp) { case WAN_STRIKING: