remove redundant null-check on untrap_prob()
`ttmp` should not be NULL here, otherwise this function will crash at earlier code.
This commit is contained in:
@@ -4468,6 +4468,7 @@ untrap_prob(struct trap *ttmp)
|
|||||||
int chance = 3;
|
int chance = 3;
|
||||||
|
|
||||||
/* Only spiders know how to deal with webs reliably */
|
/* Only spiders know how to deal with webs reliably */
|
||||||
|
/* Assume ttmp is not NULL */
|
||||||
if (ttmp->ttyp == WEB && !webmaker(g.youmonst.data))
|
if (ttmp->ttyp == WEB && !webmaker(g.youmonst.data))
|
||||||
chance = 7; /* 3.7: used to be 30 */
|
chance = 7; /* 3.7: used to be 30 */
|
||||||
if (Confusion || Hallucination)
|
if (Confusion || Hallucination)
|
||||||
@@ -4479,7 +4480,7 @@ untrap_prob(struct trap *ttmp)
|
|||||||
if (Fumbling)
|
if (Fumbling)
|
||||||
chance *= 2;
|
chance *= 2;
|
||||||
/* Your own traps are better known than others. */
|
/* Your own traps are better known than others. */
|
||||||
if (ttmp && ttmp->madeby_u)
|
if (ttmp->madeby_u)
|
||||||
chance--;
|
chance--;
|
||||||
if (Role_if(PM_ROGUE)) {
|
if (Role_if(PM_ROGUE)) {
|
||||||
if (rn2(2 * MAXULEV) < u.ulevel)
|
if (rn2(2 * MAXULEV) < u.ulevel)
|
||||||
|
|||||||
Reference in New Issue
Block a user