From 6a19659b90402e67e90c31e009c4d3fa3493ee77 Mon Sep 17 00:00:00 2001 From: havoc Date: Sat, 27 Jun 2009 10:56:56 +0000 Subject: [PATCH] patch from Lardarse that makes monsters/secrets show up if they are non-zero even if the total monsters/secrets is 0 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9033 d7cf8633-e32d-0410-b094-e92efae38249 --- sbar.c | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/sbar.c b/sbar.c index bc73eba4..5db9491f 100644 --- a/sbar.c +++ b/sbar.c @@ -674,8 +674,13 @@ void Sbar_SoloScoreboard (void) // monsters and secrets are now both on the top row if (cl.stats[STAT_TOTALMONSTERS]) Sbar_DrawString(8, 4, va("Monsters:%3i /%3i", cl.stats[STAT_MONSTERS], cl.stats[STAT_TOTALMONSTERS])); + else if (cl.stats[STAT_MONSTERS]) // LA: Display something if monsters_killed is non-zero, but total_monsters is zero + Sbar_DrawString(8, 4, va("Monsters:%3i", cl.stats[STAT_MONSTERS])); + if (cl.stats[STAT_TOTALSECRETS]) Sbar_DrawString(8+22*8, 4, va("Secrets:%3i /%3i", cl.stats[STAT_SECRETS], cl.stats[STAT_TOTALSECRETS])); + else if (cl.stats[STAT_SECRETS]) // LA: And similarly for secrets + Sbar_DrawString(8+22*8, 4, va("Secrets:%3i", cl.stats[STAT_SECRETS])); // figure out the map's filename without path or extension strlcpy(str, FS_FileWithoutPath(cl.worldmodel ? cl.worldmodel->name : ""), sizeof(str)); @@ -2148,16 +2153,30 @@ void Sbar_IntermissionOverlay (void) Sbar_DrawPic (246,64,sb_nums[0][num/10]); Sbar_DrawPic (266,64,sb_nums[0][num%10]); - Sbar_DrawNum (160, 104, cl.stats[STAT_SECRETS], 3, 0); - if (gamemode != GAME_NEXUIZ) - Sbar_DrawPic (232, 104, sb_slash); - Sbar_DrawNum (240, 104, cl.stats[STAT_TOTALSECRETS], 3, 0); - - Sbar_DrawNum (160, 144, cl.stats[STAT_MONSTERS], 3, 0); - if (gamemode != GAME_NEXUIZ) - Sbar_DrawPic (232, 144, sb_slash); - Sbar_DrawNum (240, 144, cl.stats[STAT_TOTALMONSTERS], 3, 0); +// LA: Display as "a" instead of "a/b" if b is 0 + if(cl.stats[STAT_TOTALSECRETS]) + { + Sbar_DrawNum (160, 104, cl.stats[STAT_SECRETS], 3, 0); + if (gamemode != GAME_NEXUIZ) + Sbar_DrawPic (232, 104, sb_slash); + Sbar_DrawNum (240, 104, cl.stats[STAT_TOTALSECRETS], 3, 0); + } + else + { + Sbar_DrawNum (240, 104, cl.stats[STAT_SECRETS], 3, 0); + } + if(cl.stats[STAT_TOTALMONSTERS]) + { + Sbar_DrawNum (160, 144, cl.stats[STAT_MONSTERS], 3, 0); + if (gamemode != GAME_NEXUIZ) + Sbar_DrawPic (232, 144, sb_slash); + Sbar_DrawNum (240, 144, cl.stats[STAT_TOTALMONSTERS], 3, 0); + } + else + { + Sbar_DrawNum (240, 144, cl.stats[STAT_MONSTERS], 3, 0); + } } -- 2.39.2