]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/config.qc
Merge branch 'martin-t/angles' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / config.qc
index 2b1e00c8a7d29d9db05b175bd357b4547786c480..a5a23f93780768e7a51f542bfdc2eb278ed3ad61 100644 (file)
@@ -3,11 +3,13 @@
 //  Turret Config Generator
 // ==========================
 
+#ifdef SVQC
+
 void T_Config_Queue_Swap(float root, float child, entity pass)
 {
-       string oldroot = tur_config_queue[root];
-       tur_config_queue[root] = tur_config_queue[child];
-       tur_config_queue[child] = oldroot;
+       string oldroot = config_queue[root];
+       config_queue[root] = config_queue[child];
+       config_queue[child] = oldroot;
 }
 
 float T_Config_Queue_Compare(float root, float child, entity pass)
@@ -16,8 +18,8 @@ float T_Config_Queue_Compare(float root, float child, entity pass)
 
        for(i = 1; i <= 100; ++i)
        {
-               r = str2chr(tur_config_queue[root], i);
-               c = str2chr(tur_config_queue[child], i);
+               r = str2chr(config_queue[root], i);
+               c = str2chr(config_queue[child], i);
                if(r == c) { continue; }
                else if(c > r) { return -1; }
                else { return 1; }
@@ -28,12 +30,12 @@ float T_Config_Queue_Compare(float root, float child, entity pass)
 
 void Dump_Turret_Settings()
 {
-       float x, totalsettings = 0;
+       int totalsettings = 0;
        FOREACH(Turrets, it != TUR_Null, {
                // step 1: clear the queue
                TUR_CONFIG_COUNT = 0;
-               for(x = 0; x <= MAX_TUR_CONFIG; ++x)
-                       { tur_config_queue[x] = string_null; }
+               for(int j = 0; j <= MAX_CONFIG_SETTINGS; ++j)
+                       config_queue[j] = string_null;
 
                // step 2: build new queue
                it.tr_config(it);
@@ -43,8 +45,8 @@ void Dump_Turret_Settings()
 
                // step 4: write queue
                TUR_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n", i, it.turret_name))
-               for(x = 0; x <= TUR_CONFIG_COUNT; ++x)
-                       { TUR_CONFIG_WRITETOFILE(tur_config_queue[x]) }
+               for(int j = 0; j <= TUR_CONFIG_COUNT; ++j)
+                       TUR_CONFIG_WRITETOFILE(config_queue[j])
                TUR_CONFIG_WRITETOFILE("// }}}\n")
 
                // step 5: debug info
@@ -54,9 +56,11 @@ void Dump_Turret_Settings()
 
        // clear queue now that we're finished
        TUR_CONFIG_COUNT = 0;
-       for(x = 0; x <= MAX_TUR_CONFIG; ++x)
-               { tur_config_queue[x] = string_null; }
+       for(int j = 0; j <= MAX_CONFIG_SETTINGS; ++j)
+               config_queue[j] = string_null;
 
        // extra information
        LOG_INFO(sprintf("Totals: %d turrets, %d settings\n", (Turrets_COUNT - 1), totalsettings));
 }
+
+#endif