From: nethack.allison Date: Sun, 24 Feb 2002 15:45:05 +0000 (+0000) Subject: reported a poor display result on the win32 tty X-Git-Tag: MOVE2GIT~3129 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=575228db065f98f625c642e536a5edf5e66f9602;p=nethack reported a poor display result on the win32 tty when hilite_pet was enabled. After checking into it, the test was looking for the value: (FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED) which signifies a white color on win32 console I/O. The problem was that in some cases that was OR'd with something else such as FOREGROUND_INTENSITY. Fix it by checking only the bits that matter when turning on the attribute. --- diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 0b2f21e32..f09bfdf70 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -791,7 +791,7 @@ term_start_attr(int attr) break; case ATR_INVERSE: /* Suggestion by Lee Berger */ - if (currentcolor == (FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED)) + if (currentcolor & (FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED)) currentcolor = 0; currentbackground = (BACKGROUND_RED|BACKGROUND_BLUE|BACKGROUND_GREEN); colorchange = TRUE;