From acdc62a86105f4198faa0d72bec720446305e2cd Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 15 Nov 2018 02:34:45 -0500 Subject: [PATCH] stale gold symbol displayed after symset change a stale gold symbol could be displayed on the status line following a switch to a new symset, as observed and reported for Windows RogueEpyx symset. An update is required for gold in the status line for a change to any of the following: context.rndencode value the encoded glyph value for COIN_CLASS the gold amount --- doc/fixes36.2 | 2 ++ src/botl.c | 25 ++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 8e6718ec5..2780451d3 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -198,6 +198,8 @@ clairvoyance would show trap instead of a monster on/in that trap, which was intentional, but when clairvoyance finished the monster wasn't shown nurse corpse/tin chance to convey poison resistance when eaten was not honored make tame vampires be more aggressive when shifted to bat/fog/wolf form +a stale gold symbol could be displayed on the status line following a switch + to a new symset, as observed and reported for Windows RogueEpyx symset Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/botl.c b/src/botl.c index 5d1fe2bcb..aa5d64f48 100644 --- a/src/botl.c +++ b/src/botl.c @@ -698,6 +698,7 @@ int fld, idx, idx_p; boolean *valsetlist; { static int oldrndencode = 0; + static nhsym oldgoldsym = 0; int pc, chg, color = NO_COLOR; unsigned anytype; boolean updated = FALSE, reset; @@ -719,10 +720,28 @@ boolean *valsetlist; * so $:0 has already been encoded and cached by the window * port. Without this hack, gold's \G sequence won't be * recognized and ends up being displayed as-is for 'update_all'. + * + * Also, even if context.rndencode hasn't changed and the + * gold amount itself hasn't changed, the glyph portion of the + * encoding may have changed if a new symset was put into + * effect. + * + * \GXXXXNNNN:25 + * XXXX = the context.rndencode portion + * NNNN = the glyph portion + * 25 = the gold amount + * */ - if (context.rndencode != oldrndencode && fld == BL_GOLD) { - chg = 2; - oldrndencode = context.rndencode; + + if (fld == BL_GOLD) { + if (context.rndencode != oldrndencode && fld == BL_GOLD) { + chg = 2; + oldrndencode = context.rndencode; + } + if (oldgoldsym != showsyms[COIN_CLASS + SYM_OFF_O]) { + chg = 2; + oldgoldsym = showsyms[COIN_CLASS + SYM_OFF_O]; + } } reset = FALSE; -- 2.40.0