bit logic fix (trunk only)

Fix some expressions that were supposed to use bitwise '&' but were
accidentally using logical '&&', pointed out by Keni's lint tool.  All 3
instances are in post-3.4.3 code, so don't affect the branch and don't
need a fixes entry.
This commit is contained in:
nethack.rankin
2012-01-29 00:34:33 +00:00
parent 7dd8600e17
commit c76362833a
2 changed files with 4 additions and 5 deletions

View File

@@ -1,5 +1,4 @@
/* NetHack 3.5 dogmove.c $Date$ $Revision$ */
/* SCCS Id: @(#)dogmove.c 3.5 2008/10/20 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -775,7 +774,7 @@ register int after; /* this is extra fast monster movement */
int mstatus;
register struct monst *mtmp2 = m_at(nx,ny);
mstatus = mdisplacem(mtmp, mtmp2, FALSE); /* displace monster */
if (mstatus && MM_DEF_DIED) return 2;
if (mstatus & MM_DEF_DIED) return 2;
return 0;
}
#endif /* BARGETHROUGH */

View File

@@ -1126,15 +1126,15 @@ register int mmflags;
something sensible if caller hasn't specified MM_EPRI|MM_EMIN
(when they're specified, caller intends to handle this itself) */
if ((mndx == PM_ALIGNED_PRIEST || mndx == PM_HIGH_PRIEST) ?
!(mmflags && (MM_EPRI|MM_EMIN)) :
(mndx == PM_ANGEL && !(mmflags && MM_EMIN) && !rn2(3))) {
!(mmflags & (MM_EPRI|MM_EMIN)) :
(mndx == PM_ANGEL && !(mmflags & MM_EMIN) && !rn2(3))) {
struct emin *eminp;
newemin(mtmp);
eminp = EMIN(mtmp);
mtmp->isminion = 1; /* make priest be a roamer */
eminp->min_align = rn2(3) - 1; /* no A_NONE */
eminp->renegade = (mmflags & MM_ANGRY) ? 1 : !rn2(3);
eminp->renegade = (boolean)((mmflags & MM_ANGRY) ? 1 : !rn2(3));
mtmp->mpeaceful = (eminp->min_align == u.ualign.type) ?
!eminp->renegade : eminp->renegade;
}