4 #include "../../dpdefs/progsdefs.qh"
5 #include "../../dpdefs/dpextensions.qh"
11 // ==========================
12 // Balance Config Generator
13 // ==========================
15 void W_Config_Queue_Swap(int root, int child, entity pass)
17 string oldroot = wep_config_queue[root];
18 wep_config_queue[root] = wep_config_queue[child];
19 wep_config_queue[child] = oldroot;
22 float W_Config_Queue_Compare(int root, int child, entity pass)
24 return strcmp(wep_config_queue[root], wep_config_queue[child]);
27 void Dump_Weapon_Settings(void)
29 int i, x, totalsettings = 0;
30 for(i = WEP_FIRST; i <= WEP_LAST; ++i)
32 // step 1: clear the queue
34 for(x = 0; x <= MAX_WEP_CONFIG; ++x)
35 { wep_config_queue[x] = string_null; }
37 // step 2: build new queue
38 WEP_ACTION(i, WR_CONFIG);
41 heapsort(WEP_CONFIG_COUNT, W_Config_Queue_Swap, W_Config_Queue_Compare, world);
43 // step 4: write queue
44 WEP_CONFIG_WRITETOFILE(sprintf(
48 (((get_weaponinfo(i)).spawnflags & WEP_FLAG_MUTATORBLOCKED) ? " (MUTATOR WEAPON)" : "")
50 for(x = 0; x <= WEP_CONFIG_COUNT; ++x) { WEP_CONFIG_WRITETOFILE(wep_config_queue[x]); }
51 WEP_CONFIG_WRITETOFILE("// }}}\n");
54 LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, WEP_NAME(i), WEP_CONFIG_COUNT));
55 totalsettings += WEP_CONFIG_COUNT;
58 // clear queue now that we're finished
60 for(x = 0; x <= MAX_WEP_CONFIG; ++x)
61 { wep_config_queue[x] = string_null; }
64 LOG_INFO(sprintf("Totals: %d weapons, %d settings\n", (i - 1), totalsettings));