]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix count_append, add more comments for it
authorSamual Lenks <samual@xonotic.org>
Sun, 24 Feb 2013 20:17:30 +0000 (15:17 -0500)
committerSamual Lenks <samual@xonotic.org>
Sun, 24 Feb 2013 20:17:30 +0000 (15:17 -0500)
qcsrc/common/util.qc

index c3346663328abe19a33d2fe3f9e45a5482a56604..c5a8c6446d64153f7a6200c0c118b325501a8a2f 100644 (file)
@@ -2612,10 +2612,12 @@ string count_append(float interval, string zeroth, string first, string second,
        // to accomodate all languages unless we do a specific function for each one...
        // and since that's not technically feasible/practical, this is all we've got folks.
 
-       string timestring = sprintf("%d", interval);
-       float lastnum = stof(substring(timestring, (strlen(timestring) - 1), 1));
-       
-       switch(lastnum)
+       // Basically, it just allows you to represent a number or count in different ways
+       // depending on the number... like, with count_ordinal macro in util.qh you can
+       // provide integers and retrieve 1st, 2nd, 3rd, 4th, ... nth ordinal numbers in a
+       // clean and simple way. You can also use count_seconds in the same fashion.
+
+       switch(floor(interval))
        {
                case 0: return sprintf(zeroth, interval);
                case 1: