]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/util.qc
Now make everything else compile too
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / util.qc
index 10e4e345b28298ead91a5420e4c0c11da92dc36b..5f648dd52a2f6e328854a457ac92fef15be0fbbf 100644 (file)
@@ -2107,3 +2107,11 @@ float lowestbit(float f)
        f &~= f * 65536;
        return f;
 }
+
+string strlimitedlen(string input, string truncation, float strip_colors, float limit)
+{
+       if(strlen((strip_colors ? strdecolorize(input) : input)) <= limit)
+               return input;
+       else
+               return strcat(substring(input, 0, (strlen(input) - strlen(truncation))), truncation);
+}