X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fconfig.qc;h=d932224e3a8bae0e990604ec19ed47410e05b517;hb=a8cc9eb71b0d0e44e9a968a9cf5554f6226cc838;hp=2537022f6ac55bba9cff6d12570e68ea0f12b3f9;hpb=35f53edb752c4736e4f290d98d0bf59e701d3c34;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/config.qc b/qcsrc/common/weapons/config.qc index 2537022f6..d932224e3 100644 --- a/qcsrc/common/weapons/config.qc +++ b/qcsrc/common/weapons/config.qc @@ -1,22 +1,32 @@ +#if defined(CSQC) +#elif defined(MENUQC) +#elif defined(SVQC) + #include "../../dpdefs/progsdefs.qh" + #include "../../dpdefs/dpextensions.qh" + #include "../util.qh" + #include "config.qh" + #include "all.qh" +#endif + // ========================== // Balance Config Generator // ========================== -void W_Config_Queue_Swap(float root, float child, entity pass) +void W_Config_Queue_Swap(int root, int child, entity pass) { string oldroot = wep_config_queue[root]; wep_config_queue[root] = wep_config_queue[child]; wep_config_queue[child] = oldroot; } -float W_Config_Queue_Compare(float root, float child, entity pass) +float W_Config_Queue_Compare(int root, int child, entity pass) { return strcmp(wep_config_queue[root], wep_config_queue[child]); } void Dump_Weapon_Settings(void) { - float i, x, totalsettings = 0; + int i, x, totalsettings = 0; for(i = WEP_FIRST; i <= WEP_LAST; ++i) { // step 1: clear the queue @@ -25,23 +35,24 @@ void Dump_Weapon_Settings(void) { wep_config_queue[x] = string_null; } // step 2: build new queue - WEP_ACTION(i, WR_CONFIG); + Weapon w = get_weaponinfo(i); + w.wr_config(w); // step 3: sort queue heapsort(WEP_CONFIG_COUNT, W_Config_Queue_Swap, W_Config_Queue_Compare, world); - + // step 4: write queue WEP_CONFIG_WRITETOFILE(sprintf( "// {{{ #%d: %s%s\n", i, WEP_NAME(i), (((get_weaponinfo(i)).spawnflags & WEP_FLAG_MUTATORBLOCKED) ? " (MUTATOR WEAPON)" : "") - )) - for(x = 0; x <= WEP_CONFIG_COUNT; ++x) { WEP_CONFIG_WRITETOFILE(wep_config_queue[x]) } - WEP_CONFIG_WRITETOFILE("// }}}\n") + )); + for(x = 0; x <= WEP_CONFIG_COUNT; ++x) { WEP_CONFIG_WRITETOFILE(wep_config_queue[x]); } + WEP_CONFIG_WRITETOFILE("// }}}\n"); // step 5: debug info - print(sprintf("#%d: %s: %d settings...\n", i, WEP_NAME(i), WEP_CONFIG_COUNT)); + LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, WEP_NAME(i), WEP_CONFIG_COUNT)); totalsettings += WEP_CONFIG_COUNT; } @@ -51,5 +62,5 @@ void Dump_Weapon_Settings(void) { wep_config_queue[x] = string_null; } // extra information - print(sprintf("Totals: %d weapons, %d settings\n", (i - 1), totalsettings)); + LOG_INFO(sprintf("Totals: %d weapons, %d settings\n", (i - 1), totalsettings)); }