@@ -13,15 +13,12 @@ const char *const enc_stat[] = { "", "Burdened", "Stressed",
1313STATIC_OVL NEARDATA int mrank_sz = 0 ; /* loaded by max_rank_sz (from u_init) */
1414STATIC_DCL const char * NDECL (rank );
1515
16- #ifndef STATUS_VIA_WINDOWPORT
17-
18- STATIC_DCL void NDECL (bot1 );
19- STATIC_DCL void NDECL (bot2 );
16+ #if !defined(STATUS_VIA_WINDOWPORT ) || defined(DUMPLOG )
2017
21- STATIC_OVL void
22- bot1 ()
18+ char *
19+ do_statusline1 ()
2320{
24- char newbot1 [MAXCO ];
21+ static char newbot1 [BUFSZ ];
2522 register char * nb ;
2623 register int i , j ;
2724
@@ -71,14 +68,13 @@ bot1()
7168 if (flags .showscore )
7269 Sprintf (nb = eos (nb ), " S:%ld" , botl_score ());
7370#endif
74- curs (WIN_STATUS , 1 , 0 );
75- putstr (WIN_STATUS , 0 , newbot1 );
71+ return newbot1 ;
7672}
7773
78- STATIC_OVL void
79- bot2 ()
74+ char *
75+ do_statusline2 ()
8076{
81- char newbot2 [MAXCO ], /* MAXCO: botl.h */
77+ static char newbot2 [BUFSZ ], /* MAXCO: botl.h */
8278 /* dungeon location (and gold), hero health (HP, PW, AC),
8379 experience (HD if poly'd, else Exp level and maybe Exp points),
8480 time (in moves), varying number of status conditions */
@@ -102,7 +98,8 @@ bot2()
10298 if ((money = money_cnt (invent )) < 0L )
10399 money = 0L ; /* ought to issue impossible() and then discard gold */
104100 Sprintf (eos (dloc ), "%s:%-2ld" , /* strongest hero can lift ~300000 gold */
105- encglyph (objnum_to_glyph (GOLD_PIECE )), min (money , 999999L ));
101+ iflags .in_dumplog ? "$" : encglyph (objnum_to_glyph (GOLD_PIECE )),
102+ min (money , 999999L ));
106103 dln = strlen (dloc );
107104 /* '$' encoded as \GXXXXNNNN is 9 chars longer than display will need */
108105 dx = strstri (dloc , "\\G" ) ? 9 : 0 ;
@@ -205,23 +202,25 @@ bot2()
205202 /* only two or three consecutive spaces available to squeeze out */
206203 mungspaces (newbot2 );
207204 }
208-
209- curs (WIN_STATUS , 1 , 1 );
210- putmixed (WIN_STATUS , 0 , newbot2 );
205+ return newbot2 ;
211206}
212207
208+ #ifndef STATUS_VIA_WINDOWPORT
213209void
214210bot ()
215211{
216212 if (youmonst .data && iflags .status_updates ) {
217- bot1 ();
218- bot2 ();
213+ curs (WIN_STATUS , 1 , 0 );
214+ putstr (WIN_STATUS , 0 , do_statusline1 ());
215+ curs (WIN_STATUS , 1 , 1 );
216+ putmixed (WIN_STATUS , 0 , do_statusline2 ());
219217 }
220218 context .botl = context .botlx = 0 ;
221219}
222-
223220#endif /* !STATUS_VIA_WINDOWPORT */
224221
222+ #endif /* !STATUS_VIA_WINDOWPORT || DUMPLOG */
223+
225224/* convert experience level (1..30) to rank index (0..8) */
226225int
227226xlev_to_rank (xlev )
0 commit comments