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 Weapon w = get_weaponinfo(i);
42 heapsort(WEP_CONFIG_COUNT, W_Config_Queue_Swap, W_Config_Queue_Compare, world);
44 // step 4: write queue
45 WEP_CONFIG_WRITETOFILE(sprintf(
49 (((get_weaponinfo(i)).spawnflags & WEP_FLAG_MUTATORBLOCKED) ? " (MUTATOR WEAPON)" : "")
51 for(x = 0; x <= WEP_CONFIG_COUNT; ++x) { WEP_CONFIG_WRITETOFILE(wep_config_queue[x]); }
52 WEP_CONFIG_WRITETOFILE("// }}}\n");
55 LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, WEP_NAME(i), WEP_CONFIG_COUNT));
56 totalsettings += WEP_CONFIG_COUNT;
59 // clear queue now that we're finished
61 for(x = 0; x <= MAX_WEP_CONFIG; ++x)
62 { wep_config_queue[x] = string_null; }
65 LOG_INFO(sprintf("Totals: %d weapons, %d settings\n", (i - 1), totalsettings));