couple of formatting bits

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.
This commit is contained in:
PatR
2017-04-29 16:55:38 -07:00
parent 8fc7bc548c
commit f533dbdecc
2 changed files with 8 additions and 8 deletions

View 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.

View 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() */