]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Replace some sprintfs with simpler strcats
authorterencehill <piuntn@gmail.com>
Thu, 29 Jun 2017 13:59:54 +0000 (15:59 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 29 Jun 2017 13:59:54 +0000 (15:59 +0200)
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/t_items.qc
qcsrc/lib/counting.qh

index f38d39d61867ef56ec625271f7a330012b6a74e2..b80875e36ff8bb74bd0753006966a4095377c4ce 100644 (file)
@@ -3,7 +3,7 @@
 string BUFF_NAME(int i)
 {
     Buff b = Buffs_from(i);
-    return sprintf("%s%s", rgb_to_hexcolor(b.m_color), b.m_prettyName);
+    return strcat(rgb_to_hexcolor(b.m_color), b.m_prettyName);
 }
 
 entity buff_FirstFromFlags(int _buffs)
index 5e03def2447d5132661edd66caa031f681b32f3e..811115b68071f36e358f2faa6d664b6a801f585d 100644 (file)
@@ -227,14 +227,14 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew)
             string _fn2 = substring(_fn, 0 , strlen(_fn) -4);
             this.draw = ItemDrawSimple;
 
-            if(fexists(sprintf("%s%s.md3", _fn2, autocvar_cl_simpleitems_postfix)))
-                this.mdl = strzone(sprintf("%s%s.md3", _fn2, autocvar_cl_simpleitems_postfix));
-            else if(fexists(sprintf("%s%s.dpm", _fn2, autocvar_cl_simpleitems_postfix)))
-                this.mdl = strzone(sprintf("%s%s.dpm", _fn2, autocvar_cl_simpleitems_postfix));
-            else if(fexists(sprintf("%s%s.iqm", _fn2, autocvar_cl_simpleitems_postfix)))
-                this.mdl = strzone(sprintf("%s%s.iqm", _fn2, autocvar_cl_simpleitems_postfix));
-            else if(fexists(sprintf("%s%s.mdl", _fn2, autocvar_cl_simpleitems_postfix)))
-                this.mdl = strzone(sprintf("%s%s.mdl", _fn2, autocvar_cl_simpleitems_postfix));
+            if(fexists(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".md3")))
+                this.mdl = strzone(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".md3"));
+            else if(fexists(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".dpm")))
+                this.mdl = strzone(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".dpm"));
+            else if(fexists(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".iqm")))
+                this.mdl = strzone(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".iqm"));
+            else if(fexists(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".mdl")))
+                this.mdl = strzone(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".mdl"));
             else
             {
                 this.draw = ItemDraw;
index e430a648d168a41d38a976745880113c6f3258f1..c44951225ba2bc179bfb67f7c25812ed8de135dd 100644 (file)
@@ -163,42 +163,37 @@ string process_time(float outputtype, float seconds)
 
                        if (tmp_minutes)
                        {
-                               output = sprintf(
-                                       "%s%s",
+                               output = strcat(
                                        count_minutes(tmp_minutes),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
+                                       ((output != "") ? strcat(", ", output) : ""));
                        }
 
                        if (tmp_hours)
                        {
-                               output = sprintf(
-                                       "%s%s",
+                               output = strcat(
                                        count_hours(tmp_hours),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
+                                       ((output != "") ? strcat(", ", output) : ""));
                        }
 
                        if (tmp_days)
                        {
-                               output = sprintf(
-                                       "%s%s",
+                               output = strcat(
                                        count_days(tmp_days),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
+                                       ((output != "") ? strcat(", ", output) : ""));
                        }
 
                        if (tmp_weeks)
                        {
-                               output = sprintf(
-                                       "%s%s",
+                               output = strcat(
                                        count_weeks(tmp_weeks),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
+                                       ((output != "") ? strcat(", ", output) : ""));
                        }
 
                        if (tmp_years)
                        {
-                               output = sprintf(
-                                       "%s%s",
+                               output = strcat(
                                        count_years(tmp_years),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
+                                       ((output != "") ? strcat(", ", output) : ""));
                        }
 
                        return output;
@@ -214,9 +209,8 @@ string process_time(float outputtype, float seconds)
                        if (tmp_days)
                        {
                                output = sprintf(
-                                       "%s%s",
                                        count_days(tmp_days),
-                                       ((output != "") ? sprintf(", %s", output) : ""));
+                                       ((output != "") ? strcat(", ", output) : ""));
                        }
 
                        return output;