From dce0e0cb33117e56b5d45776e36e6c8e2a233914 Mon Sep 17 00:00:00 2001 From: cohrs Date: Sun, 25 May 2003 02:35:16 +0000 Subject: [PATCH] use Is_box While inspecting some code, I noticed that detect.c wasn't using Is_box in some places it should have been. --- doc/fixes35.0 | 1 + src/detect.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 95afa50b8..8e9e7892a 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -29,6 +29,7 @@ prayer/unicorn-horn won't fix blindness while still engulfed in a dust being confused and reading cursed scroll of charging drains your energy class genocide recognizes species name as an example of the class to genocide (Martin Snyder) +internals: use Is_box rather than explicitly checking what it checks Platform- and/or Interface-Specific Fixes diff --git a/src/detect.c b/src/detect.c index 328b979b3..f4211cd55 100644 --- a/src/detect.c +++ b/src/detect.c @@ -672,7 +672,7 @@ register struct obj *sobj; else found = TRUE; } for (obj = fobj; obj; obj = obj->nobj) { - if ((obj->otyp==LARGE_BOX || obj->otyp==CHEST) && obj->otrapped) { + if (Is_box(obj) && obj->otrapped) { if (obj->ox != u.ux || obj->oy != u.uy) goto outtrapmap; else found = TRUE; @@ -703,7 +703,7 @@ outtrapmap: sense_trap(ttmp, 0, 0, sobj && sobj->cursed); for (obj = fobj; obj; obj = obj->nobj) - if ((obj->otyp==LARGE_BOX || obj->otyp==CHEST) && obj->otrapped) + if (Is_box(obj) && obj->otrapped) sense_trap((struct trap *)0, obj->ox, obj->oy, sobj && sobj->cursed); for (door = 0; door < doorindex; door++) { -- 2.40.0