Merge pull request #662 from richardradics/fix-545-loadgame-elapsed-logged
Some checks failed
Build branch / build-all (push) Failing after 14s
CodeQL / Analyze (push) Has been cancelled

fix: fix elapsed time and logged date in loadgame ui
This commit is contained in:
smallmodel 2025-02-04 23:45:15 +01:00 committed by GitHub
commit d348ac66de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -333,6 +333,7 @@ str FAKKLoadGameItem::getListItemString(int which) const
{ {
int numseconds; int numseconds;
int numseconds_hours; int numseconds_hours;
int seconds;
// hours // hours
numseconds = atol(strings[1]); numseconds = atol(strings[1]);
@ -341,17 +342,18 @@ str FAKKLoadGameItem::getListItemString(int which) const
// minutes // minutes
numseconds_hours = numseconds % 3600; numseconds_hours = numseconds % 3600;
if (numseconds_hours / 60 <= 9) { if (numseconds_hours / 60 < 10) {
itemstring += "0"; itemstring += "0";
} }
itemstring += (numseconds_hours / 60); itemstring += (numseconds_hours / 60);
itemstring += ":"; itemstring += ":";
// seconds // seconds
if (numseconds_hours / 60 <= 9) { seconds = numseconds_hours % 60;
if (seconds < 10) {
itemstring += "0"; itemstring += "0";
} }
itemstring += (numseconds_hours % 60); itemstring += seconds;
} }
break; break;
case 2: case 2:
@ -360,7 +362,7 @@ str FAKKLoadGameItem::getListItemString(int which) const
char buffer[2048]; char buffer[2048];
time = atol(strings[2]); 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; itemstring = buffer;
} }
break; break;