]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Rename the seconds variable as it doesn't contain number of seconds
authorterencehill <piuntn@gmail.com>
Tue, 26 Apr 2022 15:31:31 +0000 (17:31 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 26 Apr 2022 15:31:31 +0000 (17:31 +0200)
qcsrc/lib/string.qh

index 79ba56ebe9738c374b2bec10cf258ef070503a28..6a37d5edd4bf1727d09175f683be74bff1f43671 100644 (file)
@@ -146,11 +146,11 @@ string clockedtime_tostring(int tm, bool hundredths)
        if (tm < 0)
                return strcat("0:00:0", hundredths ? "0" : "");
        int acc = hundredths ? 6000 : 600;
-       int seconds = floor(tm + 0.5);
-       int minutes = floor(seconds / acc);
-       seconds -= minutes * acc;
+       tm = floor(tm + 0.5);
+       int minutes = floor(tm / acc);
+       int tm_without_minutes = tm - minutes * acc;
        // NOTE: the start digit of s is a placeholder and won't be displayed
-       string s = ftos(acc * 10 + seconds);
+       string s = ftos(acc * 10 + tm_without_minutes);
        return strcat(ftos(minutes), ":", substring(s, 1, 2), ".", substring(s, 3, hundredths ? 2 : 1));
 }