9 // ==========================
10 // Balance Config Generator
11 // ==========================
13 void W_Config_Queue_Swap(int root, int child, entity pass)
15 string oldroot = wep_config_queue[root];
16 wep_config_queue[root] = wep_config_queue[child];
17 wep_config_queue[child] = oldroot;
20 float W_Config_Queue_Compare(int root, int child, entity pass)
22 return strcmp(wep_config_queue[root], wep_config_queue[child]);
25 void Dump_Weapon_Settings()
27 int i, x, totalsettings = 0;
28 for(i = WEP_FIRST; i <= WEP_LAST; ++i)
30 // step 1: clear the queue
32 for(x = 0; x <= MAX_WEP_CONFIG; ++x)
33 { wep_config_queue[x] = string_null; }
35 // step 2: build new queue
36 Weapon w = get_weaponinfo(i);
40 heapsort(WEP_CONFIG_COUNT, W_Config_Queue_Swap, W_Config_Queue_Compare, world);
42 // step 4: write queue
43 WEP_CONFIG_WRITETOFILE(sprintf(
47 (((get_weaponinfo(i)).spawnflags & WEP_FLAG_MUTATORBLOCKED) ? " (MUTATOR WEAPON)" : "")
49 for(x = 0; x <= WEP_CONFIG_COUNT; ++x) { WEP_CONFIG_WRITETOFILE(wep_config_queue[x]); }
50 WEP_CONFIG_WRITETOFILE("// }}}\n");
53 LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, WEP_NAME(i), WEP_CONFIG_COUNT));
54 totalsettings += WEP_CONFIG_COUNT;
57 // clear queue now that we're finished
59 for(x = 0; x <= MAX_WEP_CONFIG; ++x)
60 { wep_config_queue[x] = string_null; }
63 LOG_INFO(sprintf("Totals: %d weapons, %d settings\n", (i - 1), totalsettings));