]> granicus.if.org Git - nethack/commitdiff
tty pet hiliting may turn off on color changes
authorcohrs <cohrs>
Thu, 31 Jan 2002 03:21:39 +0000 (03:21 +0000)
committercohrs <cohrs>
Thu, 31 Jan 2002 03:21:39 +0000 (03:21 +0000)
check to turn on hilite must come after check to change color, since
changing color uses term_end_color which may turn off inverse video too

win/tty/wintty.c

index b281e982213ba3323d1e252e6d4f6469ccd615be..31d8516e134db2987a27bcb62952d8ac3f72786e 100644 (file)
@@ -2399,12 +2399,6 @@ tty_print_glyph(window, x, y, glyph)
     }
 #endif
 
-    if (((special & MG_PET) && iflags.hilite_pet) ||
-       ((special & MG_DETECT) && iflags.use_inverse)) {
-       term_start_attr(ATR_INVERSE);
-       reverse_on = TRUE;
-    }
-
 #ifdef TEXTCOLOR
     if (color != ttyDisplay->color) {
        if(ttyDisplay->color != NO_COLOR)
@@ -2415,6 +2409,13 @@ tty_print_glyph(window, x, y, glyph)
     }
 #endif /* TEXTCOLOR */
 
+    /* must be after color check; term_end_color may turn off inverse too */
+    if (((special & MG_PET) && iflags.hilite_pet) ||
+       ((special & MG_DETECT) && iflags.use_inverse)) {
+       term_start_attr(ATR_INVERSE);
+       reverse_on = TRUE;
+    }
+
 #if defined(USE_TILES) && defined(MSDOS)
     if (iflags.grmode && iflags.tile_view)
       xputg(glyph,ch,special);