From 299fc5ff29cd0100a4946a6679ec461a26201a7c Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Sun, 24 Mar 2002 03:57:22 +0000 Subject: [PATCH] #649, #656 hilite_pet bug (from Yitzhak) #649 on Friday, March 22, 2002 at 13:27:03 software: os: w2k workstation nh: stock tty nethack.exe comments: When you move onto a space and your pet moves onto the space next to you on your left, your @ is displayed w/ normal attributes instead of bright. hilite_pet option is enabled IBMGraphics option is disabled #656 on Friday, March 22, 2002 at 16:59:37 nhfrom: 3.4.0 Official binary release for Windows 95/98/NT/2000/Me/XP software: Windows 98 SE playing the ASCII version comments: Sometimes when I'm standing next to my pet the @ turns grey, it goes back to white after I move. --- sys/winnt/nttty.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 4400f9b27..ffb51b652 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -72,6 +72,7 @@ static char nullstr[] = ""; char erase_char,kill_char; static char currentcolor = FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_BLUE; +static char noninvertedcurrentcolor = FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_BLUE; static char currenthilite = 0; static char currentbackground = 0; static boolean colorchange = TRUE; @@ -759,6 +760,7 @@ term_start_attr(int attr) switch(attr){ case ATR_INVERSE: if (iflags.wc_inverse) { + noninvertedcurrentcolor = currentcolor; /* Suggestion by Lee Berger */ if ((currentcolor & (FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED)) == (FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED)) @@ -791,13 +793,14 @@ term_end_attr(int attr) switch(attr){ case ATR_INVERSE: - if (iflags.wc_inverse) { - if (currentcolor == 0) - currentcolor = FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED; - currentbackground = 0; - colorchange = TRUE; - break; - } /* else */ + if (iflags.wc_inverse) { + if (currentcolor == 0 && noninvertedcurrentcolor != 0) + currentcolor = noninvertedcurrentcolor; + noninvertedcurrentcolor = 0; + currentbackground = 0; + colorchange = TRUE; + break; + } /* else */ /*FALLTHRU*/ case ATR_ULINE: case ATR_BOLD: