couple of formatting bits
authorPatR <rankin@nethack.org>
Sat, 29 Apr 2017 23:55:38 +0000 (16:55 -0700)
committerPatR <rankin@nethack.org>
Sat, 29 Apr 2017 23:55:38 +0000 (16:55 -0700)
timeout.c:  the luck timeout expression caused a bit of thought trying
to decide whether it was doing what was intended (it was).  Add some
parentheses so that thought is no longer required.  ;-)

worn.c:  fix up a macro where automated reformatting mistook a
bitwise-and operation for a cast applied to the address of something.

src/timeout.c
src/worn.c

index 430784e5a55288514259aac5d63177cf6a4c8126..e5187e93b9cc55149996e77a39438e49f3bf5e58 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 timeout.c       $NHDT-Date: 1456526165 2016/02/26 22:36:05 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.65 $ */
+/* NetHack 3.6 timeout.c       $NHDT-Date: 1493510119 2017/04/29 23:55:19 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.70 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -249,7 +249,7 @@ nh_timeout()
         baseluck -= 1;
 
     if (u.uluck != baseluck
-        && moves % (u.uhave.amulet || u.ugangr ? 300 : 600) == 0) {
+        && moves % ((u.uhave.amulet || u.ugangr) ? 300 : 600) == 0) {
         /* Cursed luckstones stop bad luck from timing out; blessed luckstones
          * stop good luck from timing out; normal luckstones stop both;
          * neither is stopped if you don't have a luckstone.
index 947f367b970cca2db47a3bce4dc4453a64ba6eaf..a99d1336d80cafeeb14683a16359944f33405989 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 worn.c  $NHDT-Date: 1446887541 2015/11/07 09:12:21 $  $NHDT-Branch: master $:$NHDT-Revision: 1.47 $ */
+/* NetHack 3.6 worn.c  $NHDT-Date: 1493510127 2017/04/29 23:55:27 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.48 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -31,11 +31,11 @@ const struct worn {
              { 0, 0 } };
 
 /* This only allows for one blocking item per property */
-#define w_blocks(o, m)                                                     \
-    ((o->otyp == MUMMY_WRAPPING && ((m) &W_ARMC))                          \
-         ? INVIS                                                           \
-         : (o->otyp == CORNUTHAUM && ((m) &W_ARMH) && !Role_if(PM_WIZARD)) \
-               ? CLAIRVOYANT                                               \
+#define w_blocks(o, m) \
+    ((o->otyp == MUMMY_WRAPPING && ((m) & W_ARMC))                          \
+         ? INVIS                                                            \
+         : (o->otyp == CORNUTHAUM && ((m) & W_ARMH) && !Role_if(PM_WIZARD)) \
+               ? CLAIRVOYANT                                                \
                : 0)
 /* note: monsters don't have clairvoyance, so your role
    has no significant effect on their use of w_blocks() */