From 0fab87500eb790b361f2909c1f3e9d20d507b461 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 11 Mar 2022 09:58:40 -0800 Subject: [PATCH] github PR #694 - redundant null check Pull request from argrath: a check for null trap in untrap_prob() comes after an unconditional use of that trap so doesn't server any useful purpose. Redo a couple of comments too. No fixes entry necessary. Closes #694 --- src/trap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/trap.c b/src/trap.c index 09af868f1..98da044f2 100644 --- a/src/trap.c +++ b/src/trap.c @@ -4463,12 +4463,12 @@ dountrap(void) /* Probability of disabling a trap. Helge Hafting */ static int -untrap_prob(struct trap *ttmp) +untrap_prob( + struct trap *ttmp) /* must not be Null */ { int chance = 3; - /* Only spiders know how to deal with webs reliably */ - /* Assume ttmp is not NULL */ + /* non-spiders are less adept at dealing with webs */ if (ttmp->ttyp == WEB && !webmaker(g.youmonst.data)) chance = 7; /* 3.7: used to be 30 */ if (Confusion || Hallucination)