]> granicus.if.org Git - nethack/commitdiff
cancelled yellow lights
authorarromdee <arromdee>
Mon, 4 Nov 2002 06:55:55 +0000 (06:55 +0000)
committerarromdee <arromdee>
Mon, 4 Nov 2002 06:55:55 +0000 (06:55 +0000)
Someone reported this one to us.

doc/fixes34.1
src/mhitm.c

index 79333329198aa7b60a4dc292a62fd381b9cb539c..0059b15f1110b761bbab650f716998e74a5ce860 100644 (file)
@@ -290,6 +290,8 @@ handle polearm wielded prior to mounting the same as one wielded while mounted,
        and one still used after dismounting like one wielded while not mounted
 non-lawful angels don't chat using lawful messages and shouldn't summon
        lawful help
+cancelled yellow lights should not explode against other monsters, as well as
+       not exploding against you
 
 
 Platform- and/or Interface-Specific Fixes
index 18f41cfdba47408d6a2c1d2073f0590f372f59b9..593ad5606bf3f1f314fb9a1c1b6831105ae99f5c 100644 (file)
@@ -306,8 +306,12 @@ mattackm(magr, mdef)
                break;
 
            case AT_EXPL:
-               strike = 1;     /* automatic hit */
                res[i] = explmm(magr, mdef, mattk);
+               if (res[i] == MM_MISS) { /* cancelled--no attack */
+                   strike = 0;
+                   attk = 0;
+               } else
+                   strike = 1; /* automatic hit */
                break;
 
            case AT_ENGL:
@@ -537,6 +541,9 @@ explmm(magr, mdef, mattk)
 {
        int result;
 
+       if (magr->mcan)
+           return MM_MISS;
+
        if(cansee(magr->mx, magr->my))
                pline("%s explodes!", Monnam(magr));
        else    noises(magr, mattk);