]> granicus.if.org Git - nethack/commitdiff
fix B1022 -- bare handed to-hit bonus
authornethack.rankin <nethack.rankin>
Fri, 8 Feb 2002 00:15:32 +0000 (00:15 +0000)
committernethack.rankin <nethack.rankin>
Fri, 8 Feb 2002 00:15:32 +0000 (00:15 +0000)
     Make the code match the comments.  I'm sure I checked that
forwards and backwards when I put it in; I don't know how it ended
up mismatched.

src/weapon.c

index 500b0d1e238ebb073bc0cca92e7d2dc58f50b251..58f94b07a43064a5afe5459d3bca42193c0af4ba 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)weapon.c   3.4     2000/09/17      */
+/*     SCCS Id: @(#)weapon.c   3.4     2002/02/07      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1046,7 +1046,7 @@ struct obj *weapon;
         */
        bonus = P_SKILL(type);
        bonus = max(bonus,P_UNSKILLED) - 1;     /* unskilled => 0 */
-       bonus = (bonus * (martial_bonus() ? 2 : 1)) / 2;
+       bonus = ((bonus + 2) * (martial_bonus() ? 2 : 1)) / 2;
     }
 
 #ifdef STEED