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 totalweapons = 0, totalsettings = 0;
28 FOREACH(Weapons, it != WEP_Null, LAMBDA(
29 // step 1: clear the queue
31 for (int x = 0; x <= MAX_WEP_CONFIG; ++x)
32 { wep_config_queue[x] = string_null; }
34 // step 2: build new queue
38 heapsort(WEP_CONFIG_COUNT, W_Config_Queue_Swap, W_Config_Queue_Compare, world);
40 // step 4: write queue
41 WEP_CONFIG_WRITETOFILE(sprintf(
45 ((it.spawnflags & WEP_FLAG_MUTATORBLOCKED) ? " (MUTATOR WEAPON)" : "")
47 for (int x = 0; x <= WEP_CONFIG_COUNT; ++x) { WEP_CONFIG_WRITETOFILE(wep_config_queue[x]); }
48 WEP_CONFIG_WRITETOFILE("// }}}\n");
51 LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, it.m_name, WEP_CONFIG_COUNT));
53 totalsettings += WEP_CONFIG_COUNT;
56 // clear queue now that we're finished
58 for(int x = 0; x <= MAX_WEP_CONFIG; ++x)
59 { wep_config_queue[x] = string_null; }
62 LOG_INFO(sprintf("Totals: %d weapons, %d settings\n", totalweapons, totalsettings));