Fix invisible gold symbol in status lines
This commit is contained in:
13
src/botl.c
13
src/botl.c
@@ -83,6 +83,16 @@ do_statusline1()
|
||||
return newbot1;
|
||||
}
|
||||
|
||||
void
|
||||
check_gold_symbol()
|
||||
{
|
||||
int goldch, goldoc;
|
||||
unsigned int goldos;
|
||||
int goldglyph = objnum_to_glyph(GOLD_PIECE);
|
||||
(void) mapglyph(goldglyph, &goldch, &goldoc, &goldos, 0, 0);
|
||||
iflags.invis_goldsym = ((char)goldch <= ' ');
|
||||
}
|
||||
|
||||
char *
|
||||
do_statusline2()
|
||||
{
|
||||
@@ -110,7 +120,8 @@ do_statusline2()
|
||||
if ((money = money_cnt(invent)) < 0L)
|
||||
money = 0L; /* ought to issue impossible() and then discard gold */
|
||||
Sprintf(eos(dloc), "%s:%-2ld", /* strongest hero can lift ~300000 gold */
|
||||
iflags.in_dumplog ? "$" : encglyph(objnum_to_glyph(GOLD_PIECE)),
|
||||
(iflags.in_dumplog || iflags.invis_goldsym) ? "$"
|
||||
: encglyph(objnum_to_glyph(GOLD_PIECE)),
|
||||
min(money, 999999L));
|
||||
dln = strlen(dloc);
|
||||
/* '$' encoded as \GXXXXNNNN is 9 chars longer than display will need */
|
||||
|
||||
1
src/do.c
1
src/do.c
@@ -1254,6 +1254,7 @@ boolean at_stairs, falling, portal;
|
||||
#ifdef USE_TILES
|
||||
substitute_tiles(newlevel);
|
||||
#endif
|
||||
check_gold_symbol();
|
||||
/* record this level transition as a potential seen branch unless using
|
||||
* some non-standard means of transportation (level teleport).
|
||||
*/
|
||||
|
||||
@@ -3651,6 +3651,7 @@ boolean tinitial, tfrom_file;
|
||||
/* Is it a symbol? */
|
||||
if (strstr(opts, "S_") == opts && parsesymbols(opts)) {
|
||||
switch_symbols(TRUE);
|
||||
check_gold_symbol();
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -4152,6 +4153,7 @@ doset() /* changing options via menu by Per Liboriussen */
|
||||
|
||||
destroy_nhwindow(tmpwin);
|
||||
if (need_redraw) {
|
||||
check_gold_symbol();
|
||||
reglyph_darkroom();
|
||||
(void) doredraw();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user