From e63f5e1ae765bd78901005602003560ce230c353 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 22 Oct 2020 19:40:39 +1100 Subject: [PATCH] - Duke (RR): Fix bad text setup in `DrawWeaponBar()`. * Fixes #2 of https://forum.zdoom.org/viewtopic.php?f=340&t=70284. --- source/games/duke/src/sbar_r.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/games/duke/src/sbar_r.cpp b/source/games/duke/src/sbar_r.cpp index 945267b52..d9c3dde20 100644 --- a/source/games/duke/src/sbar_r.cpp +++ b/source/games/duke/src/sbar_r.cpp @@ -302,10 +302,10 @@ public: DrawGraphic(tileGetTexture(WEAPONBAR), 0, 158, DI_ITEM_OFFSETS, 1, 0, 0, sbscale, sbscale); - FString format; for (int i = 0; i < 9; i++) { FGameTexture* img = nullptr; + FString format; if ((g_gameType & GAMEFLAG_RRRA) && i == 4 && p->curr_weapon == CHICKEN_WEAPON) { @@ -326,7 +326,10 @@ public: DrawGraphic(img, 18 + i * 32, top - 6.5, DI_ITEM_OFFSETS, 1, 0, 0, sbscale, sbscale); } - SBar_DrawString(this, &miniFont, format, 38 + i * 32, 162.75 - miniFont.mFont->GetHeight() * scale * 0.5, DI_TEXT_ALIGN_CENTER, CR_UNTRANSLATED, 1, 0, 0, scale * .875, scale * .875); + if (format.Len()) + { + SBar_DrawString(this, &miniFont, format, 38 + i * 32, 162.75 - miniFont.mFont->GetHeight() * scale * 0.5, DI_TEXT_ALIGN_CENTER, CR_UNTRANSLATED, 1, 0, 0, scale * .875, scale * .875); + } } }