fputs(wep_config_file, a); \
if(wep_config_alsoprint) { print(a); } }
-#define WEP_CONFIG_WRITE_CVARS_PRI(wepname,name) \
- { WEP_CONFIG_QUEUE( \
- sprintf("set g_balance_%s_primary_%s %g\n", #wepname, #name, \
- cvar(sprintf("g_balance_%s_primary_%s", #wepname, #name)))) }
-
-#define WEP_CONFIG_WRITE_CVARS_SEC(wepname,name) \
- { WEP_CONFIG_QUEUE( \
- sprintf("set g_balance_%s_secondary_%s %g\n", #wepname, #name, \
- cvar(sprintf("g_balance_%s_secondary_%s", #wepname, #name)))) }
-
-#define WEP_CONFIG_WRITE_CVARS_BOTH(wepname,name) \
- { WEP_CONFIG_QUEUE( \
- sprintf("set g_balance_%s_primary_%s %g\n", #wepname, #name, \
- cvar(sprintf("g_balance_%s_primary_%s", #wepname, #name)))) } \
- { WEP_CONFIG_QUEUE( \
- sprintf("set g_balance_%s_secondary_%s %g\n", #wepname, #name, \
- cvar(sprintf("g_balance_%s_secondary_%s", #wepname, #name)))) }
-
#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_PROPS_string(wepname,name) \
// =====================
// create cvars for weapon settings
-#define WEP_ADD_CVAR_PRI(wepname,name) final float autocvar_g_balance_##wepname##_primary_##name;
-#define WEP_ADD_CVAR_SEC(wepname,name) final float autocvar_g_balance_##wepname##_secondary_##name;
-#define WEP_ADD_CVAR_BOTH(wepname,name) \
- final float autocvar_g_balance_##wepname##_primary_##name; \
- final float autocvar_g_balance_##wepname##_secondary_##name;
#define WEP_ADD_CVAR_NONE(wepname,name) final float autocvar_g_balance_##wepname##_##name;
+
+#define WEP_ADD_CVAR_PRI(wepname,name) WEP_ADD_CVAR_NONE(wepname, primary_##name)
+#define WEP_ADD_CVAR_SEC(wepname,name) WEP_ADD_CVAR_NONE(wepname, secondary_##name)
+#define WEP_ADD_CVAR_BOTH(wepname,name) \
+ WEP_ADD_CVAR_PRI(wepname, name) \
+ WEP_ADD_CVAR_SEC(wepname, name)
+
#define WEP_ADD_CVAR(wepid,wepname,mode,name) WEP_ADD_CVAR_##mode(wepname, name)
// create properties for weapon settings