]> granicus.if.org Git - nethack/commitdiff
more Amask2align()
authorPatR <rankin@nethack.org>
Sun, 1 Nov 2020 22:30:25 +0000 (14:30 -0800)
committerPatR <rankin@nethack.org>
Sun, 1 Nov 2020 22:30:25 +0000 (14:30 -0800)
Recent change to Amask2align() was only masking the shrine bit
off its argument some of the time.

include/align.h

index 055fb13ed5cf7881054a826dc367b571851d1546..bd7b70cc19e28f7d40b17425fbdc6d824af9a88a 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 align.h $NHDT-Date: 1604105154 2020/10/31 00:45:54 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.14 $ */
+/* NetHack 3.7 align.h $NHDT-Date: 1604269810 2020/11/01 22:30:10 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.15 $ */
 /* Copyright (c) Mike Stephenson, Izchak Miller  1991.           */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -42,7 +42,7 @@ typedef struct align { /* alignment & record */
 #define Amask2align(x) \
     ((aligntyp) ((((x) & AM_MASK) == 0) ? A_NONE                \
                  : (((x) & AM_MASK) == AM_LAWFUL) ? A_LAWFUL    \
-                   : ((int) (x) - 2))) /* 2 => 0, 1 => -1 */
+                   : ((int) ((x) & AM_MASK)) - 2)) /* 2 => 0, 1 => -1 */
 #define Align2amask(x) \
     ((unsigned) (((x) == A_NONE) ? AM_NONE                      \
                  : ((x) == A_LAWFUL) ? AM_LAWFUL                \