]> granicus.if.org Git - nethack/commitdiff
R1007 - Monk kicking bug
authornethack.rankin <nethack.rankin>
Fri, 26 Jul 2002 00:33:14 +0000 (00:33 +0000)
committernethack.rankin <nethack.rankin>
Fri, 26 Jul 2002 00:33:14 +0000 (00:33 +0000)
     Kicking a monster as a monk or samurai or while wearing kicking
boots might make it "reel from the blow" and be knocked back a step.
If that knock back put it into a trap which killed it, the kicking
code would kill it an extra time, then the player would get a warning
about dmonsfree finding the wrong number of dead monsters.

doc/fixes34.1
src/dokick.c

index 04ab741d9449024a755e64fae8cda794437853ae..0272c0b0e880f2478dee555a34df315d7dbe9268 100644 (file)
@@ -172,6 +172,8 @@ fix bug preventing wishing for bear traps (not beartrap objects) in debug mode
 be notified about cessation of hallucinations even if blind and the time
 when using '/' to examine multiple map items in succession, don't mislabel
        some with "or a splash of venom" after having looked at a '.' item
+martial arts kick that knocks a monster into a trap would result in warning
+       "dmonsfree: 1 removed doesn't match 2 pending" if the trap was fatal
 
 
 Platform- and/or Interface-Specific Fixes
index 969baf855f4ae4758b281288d696da175fec175c..5de4508b2c8b760f74d3231ea5d2e6d9ea7a253b 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)dokick.c   3.4     2000/04/21      */
+/*     SCCS Id: @(#)dokick.c   3.4     2002/07/25      */
 /* Copyright (c) Izchak Miller, Mike Stephenson, Steve Linhart, 1989. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -34,6 +34,7 @@ register boolean clumsy;
        register int dmg = ( ACURRSTR + ACURR(A_DEX) + ACURR(A_CON) )/ 15;
        int kick_skill = P_NONE;
        int blessed_foot_damage = 0;
+       boolean trapkilled = FALSE;
 
        if (uarmf && uarmf->otyp == KICKING_BOOTS)
            dmg += 5;
@@ -100,13 +101,13 @@ register boolean clumsy;
                            place_monster(mon, mdx, mdy);
                            newsym(mon->mx, mon->my);
                            set_apparxy(mon);
-                           (void) mintrap(mon);
+                           if (mintrap(mon) == 2) trapkilled = TRUE;
                        }
                }
        }
 
        (void) passive(mon, TRUE, mon->mhp > 0, AT_KICK);
-       if (mon->mhp <= 0) killed(mon);
+       if (mon->mhp <= 0 && !trapkilled) killed(mon);
 
        /* may bring up a dialog, so put this after all messages */
        if (kick_skill != P_NONE)       /* exercise proficiency */