]> granicus.if.org Git - nethack/commitdiff
fix a couple of status items, gold highlighting and a boundary check
authornhmall <nhmall@nethack.org>
Tue, 15 May 2018 13:03:35 +0000 (09:03 -0400)
committernhmall <nhmall@nethack.org>
Tue, 15 May 2018 13:03:35 +0000 (09:03 -0400)
typo
gold highlighting
boundary check on tty_curs()

win/tty/wintty.c

index f9591c29e4a5facddee2cc120f84a48a15fa44c8..8a2e30a02a667ed5e4b477ecea523f6a8f9e8404 100644 (file)
@@ -3918,7 +3918,7 @@ int x, y;
     } else {
         /* Now we're truncating */
         if (truncation_expected)
-            ; /* but we new in advance */
+            ; /* but we knew in advance */
     }
 }
 
@@ -4158,6 +4158,11 @@ render_status(VOID_ARGS)
                             }
                         }
                     }
+                    if (x >= cw->cols) {
+                        if (!truncation_expected)
+                            paniclog("render_status()", " unexpected truncation.");
+                        x = cw->cols - 1;
+                    }
                     tty_curs(WIN_STATUS, x, y);
                     cl_end();
                 } else if (fldidx == BL_GOLD) {
@@ -4167,9 +4172,21 @@ render_status(VOID_ARGS)
                      * |   Gold    |
                      * +-----------+
                      */
+                    if (iflags.hilite_delta) {
+                        /* multiple attributes can be in effect concurrently */
+                        Begin_Attr(attridx);
+                        if (do_color && coloridx != NO_COLOR
+                            && coloridx != CLR_MAX)
+                            term_start_color(coloridx);
+                    }
                     /* decode_mixed() due to GOLD glyph */
                     tty_putstatusfield(nullfield,
                                        decode_mixed(buf, text), x, y);
+                    if (iflags.hilite_delta) {
+                        if (do_color && coloridx != NO_COLOR)
+                            term_end_color();
+                        End_Attr(attridx);
+                    }
                 } else if (hitpointbar) {
                     /*
                      * +-------------------------+