X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fconfig.qh;h=883082c97d02ed22df2c6910c1123542f2d09818;hb=d7ecf0b99095f97132ddb1252268ff7d7fb8597b;hp=77edc196023bd724ba3fe1008020b25691dc889f;hpb=35e8f712933b0ebf9b163b7289cf975825b33803;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/config.qh b/qcsrc/common/weapons/config.qh index 77edc1960..883082c97 100644 --- a/qcsrc/common/weapons/config.qh +++ b/qcsrc/common/weapons/config.qh @@ -1,82 +1,35 @@ -#ifndef WEAPONS_CONFIG_H -#define WEAPONS_CONFIG_H - -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../util-pre.qh" - #include "../../server/sys-pre.qh" - #include "../../dpdefs/progsdefs.qh" - #include "../../dpdefs/dpextensions.qh" - #include "../../server/sys-post.qh" - #include "../../warpzonelib/anglestransform.qh" - #include "../../warpzonelib/mathlib.qh" - #include "../../warpzonelib/common.qh" - #include "../../warpzonelib/util_server.qh" - #include "../../warpzonelib/server.qh" - #include "../constants.qh" - #include "../stats.qh" - #include "../teams.qh" - #include "../util.qh" - #include "../nades.qh" - #include "../buffs.qh" - #include "../test.qh" - #include "../counting.qh" - #include "../urllib.qh" - #include "../command/markup.qh" - #include "../command/rpn.qh" - #include "../command/generic.qh" - #include "../command/shared_defs.qh" - #include "../net_notice.qh" - #include "../animdecide.qh" - #include "../monsters/monsters.qh" - #include "../monsters/sv_monsters.qh" - #include "../monsters/spawn.qh" -#endif +#pragma once +#ifdef SVQC // ========================== // Balance Config Generator // ========================== -void Dump_Weapon_Settings(void); +void Dump_Weapon_Settings(); int wep_config_file; bool wep_config_alsoprint; -const int MAX_WEP_CONFIG = 256; int WEP_CONFIG_COUNT; -string wep_config_queue[MAX_WEP_CONFIG]; - #define WEP_CONFIG_QUEUE(a) { \ - wep_config_queue[WEP_CONFIG_COUNT] = a; \ + config_queue[WEP_CONFIG_COUNT] = a; \ ++WEP_CONFIG_COUNT; } -#define WEP_CONFIG_WRITETOFILE(a) do { \ +#define WEP_CONFIG_WRITETOFILE(a) MACRO_BEGIN \ fputs(wep_config_file, a); \ - if(wep_config_alsoprint) { print(a); } \ -} while(0) + if(wep_config_alsoprint) { LOG_INFO(a); } \ +MACRO_END -#define WEP_CONFIG_WRITE_CVARS_NONE(wepname,name) \ - { WEP_CONFIG_QUEUE( \ - sprintf("set g_balance_%s_%s %g\n", #wepname, #name, \ - cvar(sprintf("g_balance_%s_%s", #wepname, #name)))) } -#define WEP_CONFIG_WRITE_CVARS_PRI(wepname,name) WEP_CONFIG_WRITE_CVARS_NONE(wepname, primary_##name) -#define WEP_CONFIG_WRITE_CVARS_SEC(wepname,name) WEP_CONFIG_WRITE_CVARS_NONE(wepname, secondary_##name) -#define WEP_CONFIG_WRITE_CVARS_BOTH(wepname,name) \ - WEP_CONFIG_WRITE_CVARS_PRI(wepname, name) \ - WEP_CONFIG_WRITE_CVARS_SEC(wepname, name) - -#define WEP_CONFIG_WRITE_CVARS(wepid,wepname,mode,name) WEP_CONFIG_WRITE_CVARS_##mode(wepname, name) +#define WEP_CONFIG_WRITE_CVARS(wepname, name, T) WEP_CONFIG_WRITE_PROPS_##T(wepname, name) -#define WEP_CONFIG_WRITE_PROPS_string(wepname,name) \ +#define WEP_CONFIG_WRITE_PROPS_string(wepname, name) \ { WEP_CONFIG_QUEUE( \ sprintf("set g_balance_%s_%s \"%s\"\n", #wepname, #name, \ cvar_string(sprintf("g_balance_%s_%s", #wepname, #name)))) } -#define WEP_CONFIG_WRITE_PROPS_float(wepname,name) \ +#define WEP_CONFIG_WRITE_PROPS_float(wepname, name) \ { WEP_CONFIG_QUEUE( \ sprintf("set g_balance_%s_%s %g\n", #wepname, #name, \ cvar(sprintf("g_balance_%s_%s", #wepname, #name)))) } -#define WEP_CONFIG_WRITE_PROPS(wepid,wepname,type,prop,name) WEP_CONFIG_WRITE_PROPS_##type(wepname,name) -#endif \ No newline at end of file +#endif