]> granicus.if.org Git - nethack/commitdiff
Revert one GCC warning
authorPasi Kallinen <paxed@alt.org>
Tue, 31 Mar 2015 07:20:20 +0000 (10:20 +0300)
committerPasi Kallinen <paxed@alt.org>
Tue, 31 Mar 2015 07:20:20 +0000 (10:20 +0300)
src/trap.c

index f30fb5a6de5d06d21bbbc192d1708065f92fd9de..3c3f666423d1281a3dbd988916df043109bb6b3c 100644 (file)
@@ -4266,7 +4266,7 @@ boolean trapdoor_only;
 boolean *noticed;      /* set to true iff hero notices the effect; */
 {                      /* otherwise left with its previous value intact */
     struct trap *t;
-    boolean ishero = (mon == &youmonst);
+    boolean ishero = (mon == &youmonst), result;
 
     if (mon == u.usteed) ishero = TRUE;
     t = t_at(ishero ? u.ux : mon->mx, ishero ? u.uy : mon->my);
@@ -4281,6 +4281,7 @@ boolean *noticed; /* set to true iff hero notices the effect; */
        if (u.utrap) return FALSE;      /* already trapped */
        *noticed = TRUE;
        dotrap(t, FORCETRAP);
+       result = (u.utrap != 0);
     } else {
        if (mon->mtrapped) return FALSE;        /* already trapped */
        /* you notice it if you see the trap close/tremble/whatever
@@ -4289,6 +4290,7 @@ boolean *noticed; /* set to true iff hero notices the effect; */
        /* monster will be angered; mintrap doesn't handle that */
        wakeup(mon);
        ++force_mintrap;
+       result = (mintrap(mon) != 0);
        --force_mintrap;
        /* mon might now be on the migrating monsters list */
     }