]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/config.qc
Introduce the shared function write_String_To_File that can be used by all the dump...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / config.qc
index 7d1a81d490b1be213ad7d12faa20ca3d6e2d6355..d1a980d76e0ce2c358d3f7f7de5462a149b718aa 100644 (file)
@@ -3,6 +3,8 @@
 //  Turret Config Generator
 // ==========================
 
+#ifdef SVQC
+
 void T_Config_Queue_Swap(float root, float child, entity pass)
 {
        string oldroot = config_queue[root];
@@ -28,6 +30,7 @@ float T_Config_Queue_Compare(float root, float child, entity pass)
 
 void Dump_Turret_Settings()
 {
+       #define TUR_CONFIG_WRITETOFILE(str) write_String_To_File(tur_config_file, str, tur_config_alsoprint)
        int totalsettings = 0;
        FOREACH(Turrets, it != TUR_Null, {
                // step 1: clear the queue
@@ -42,15 +45,16 @@ void Dump_Turret_Settings()
                heapsort(TUR_CONFIG_COUNT, T_Config_Queue_Swap, T_Config_Queue_Compare, NULL);
 
                // step 4: write queue
-               TUR_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n", i, it.turret_name))
+               TUR_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n", i, it.turret_name));
                for(int j = 0; j <= TUR_CONFIG_COUNT; ++j)
-                       TUR_CONFIG_WRITETOFILE(config_queue[j])
-               TUR_CONFIG_WRITETOFILE("// }}}\n")
+                       TUR_CONFIG_WRITETOFILE(config_queue[j]);
+               TUR_CONFIG_WRITETOFILE("// }}}\n");
 
                // step 5: debug info
-               LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, it.turret_name, TUR_CONFIG_COUNT));
+               LOG_INFOF("#%d: %s: %d settings...", i, it.turret_name, TUR_CONFIG_COUNT);
                totalsettings += TUR_CONFIG_COUNT;
        });
+       #undef TUR_CONFIG_WRITETOFILE
 
        // clear queue now that we're finished
        TUR_CONFIG_COUNT = 0;
@@ -58,5 +62,7 @@ void Dump_Turret_Settings()
                config_queue[j] = string_null;
 
        // extra information
-       LOG_INFO(sprintf("Totals: %d turrets, %d settings\n", (Turrets_COUNT - 1), totalsettings));
+       LOG_INFOF("Totals: %d turrets, %d settings", (Turrets_COUNT - 1), totalsettings);
 }
+
+#endif