From fd4f5e7d518d1c8ccfe3dd583ec9ef771b4a2a17 Mon Sep 17 00:00:00 2001 From: Richard Radics Date: Tue, 4 Feb 2025 22:14:52 +0100 Subject: [PATCH] fix: fix elapsed time and logged date in loadgame ui fixes #545 --- code/client/cl_uiloadsave.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/client/cl_uiloadsave.cpp b/code/client/cl_uiloadsave.cpp index ac682170..206bb38b 100644 --- a/code/client/cl_uiloadsave.cpp +++ b/code/client/cl_uiloadsave.cpp @@ -333,6 +333,7 @@ str FAKKLoadGameItem::getListItemString(int which) const { int numseconds; int numseconds_hours; + int seconds; // hours numseconds = atol(strings[1]); @@ -341,17 +342,18 @@ str FAKKLoadGameItem::getListItemString(int which) const // minutes numseconds_hours = numseconds % 3600; - if (numseconds_hours / 60 <= 9) { + if (numseconds_hours / 60 < 10) { itemstring += "0"; } itemstring += (numseconds_hours / 60); itemstring += ":"; // seconds - if (numseconds_hours / 60 <= 9) { + seconds = numseconds_hours % 60; + if (seconds < 10) { itemstring += "0"; } - itemstring += (numseconds_hours % 60); + itemstring += seconds; } break; case 2: @@ -360,7 +362,7 @@ str FAKKLoadGameItem::getListItemString(int which) const char buffer[2048]; time = atol(strings[2]); - strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", localtime(&time)); + strftime(buffer, sizeof(buffer), "%a %b %d %Y %H:%M:%S", localtime(&time)); itemstring = buffer; } break;