]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
HUD_Write_PanelCvar: avoid a repeated strcat by not passing strcated string to HUD_Wr...
authorterencehill <piuntn@gmail.com>
Mon, 26 Jun 2017 14:07:24 +0000 (16:07 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 26 Jun 2017 14:07:24 +0000 (16:07 +0200)
qcsrc/client/hud/hud_config.qc

index b0c01e65510d8d5c626b10f69a42b66293b1fd39..64b951e9662564390c30b7742ffd8f85045cbc7b 100644 (file)
@@ -5,12 +5,13 @@
 
 #define HUD_Write(s) fputs(fh, s)
 #define HUD_Write_Cvar(cvar) HUD_Write(strcat("seta ", cvar, " \"", cvar_string(cvar), "\"\n"))
-#define HUD_Write_PanelCvar(cvar_suf) HUD_Write_Cvar(strcat("hud_panel_", panel.panel_name, cvar_suf))
+#define HUD_Write_PanelCvar(cvar_suf) str = strcat("hud_panel_", panel.panel_name, cvar_suf), HUD_Write_Cvar(str)
 // Save the config
 void HUD_Panel_ExportCfg(string cfgname)
 {
        float fh;
        string filename = strcat("hud_", autocvar_hud_skin, "_", cfgname, ".cfg");
+       string str = "";
        fh = fopen(filename, FILE_WRITE);
        if(fh >= 0)
        {