]> granicus.if.org Git - nethack/commitdiff
use Is_box
authorcohrs <cohrs>
Sun, 25 May 2003 02:35:16 +0000 (02:35 +0000)
committercohrs <cohrs>
Sun, 25 May 2003 02:35:16 +0000 (02:35 +0000)
While inspecting some code, I noticed that detect.c wasn't using Is_box in
some places it should have been.

doc/fixes35.0
src/detect.c

index 95afa50b8877b3b4117f1fc0eab355dae11ab836..8e9e7892a269dd851c0d0f3fa15133336b73221c 100644 (file)
@@ -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
index 328b979b3e67aa2a1dcfd8105c095a41f078c829..f4211cd5580a7f5ac7dbbe44dcfb95960a392966 100644 (file)
@@ -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++) {