From 0b71b2f71fc075611c26eee9d6e2598399612a17 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 12 Mar 2023 20:16:03 +0000 Subject: [PATCH] M_DrawStatistics: Fix "Hours/Minutes/Seconds" plurality if there's only 1 --- src/k_menudraw.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index fb1977c2e..1d848e974 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -5729,18 +5729,19 @@ void M_DrawStatistics(void) { if (besttime >= 24) { - strcat(beststr, va("%u days, ", besttime/24)); + strcat(beststr, va("%u day%s, ", besttime/24, (besttime < 48 ? "" : "s"))); besttime %= 24; } - strcat(beststr, va("%u hours, ", besttime)); + strcat(beststr, va("%u hour%s, ", besttime, (besttime == 1 ? "" : "s"))); } besttime = G_TicsToMinutes(gamedata->totalplaytime, false); if (besttime) { - strcat(beststr, va("%u minutes, ", besttime)); + strcat(beststr, va("%u minute%s, ", besttime, (besttime == 1 ? "" : "s"))); } - strcat(beststr, va("%i seconds", G_TicsToSeconds(gamedata->totalplaytime))); + besttime = G_TicsToSeconds(gamedata->totalplaytime); + strcat(beststr, va("%i second%s", besttime, (besttime == 1 ? "" : "s"))); V_DrawRightAlignedThinString(BASEVIDWIDTH-20, 22, V_6WIDTHSPACE, beststr); beststr[0] = 0;