#define WEP_CONFIG_WRITE_CVARS(wepid,wepname,mode,name) WEP_CONFIG_WRITE_CVARS_##mode(wepname, name)
// WEAPONTODO: remove prop
-#define WEP_CONFIG_WRITE_PROPS(wepid,wepname,unused,name) \
+#define WEP_CONFIG_WRITE_PROPS(wepid,wepname,mode,name) \
{ WEP_CONFIG_QUEUE( \
sprintf("set g_balance_%s_%s %g\n", #wepname, #name, \
cvar(sprintf("g_balance_%s_%s", #wepname, #name)))) }
#define MO_SEC 2
#define MO_BOTH 3
-#define WEP_DUPECHECK(dupecheck,cvar) float cvar;
-
-/*#define WEP_DUPECHECK(dupecheck,cvar) \
- #ifndef dupecheck \
- #define dupecheck \
- float cvar; \
- #else \
- #error DUPLICATE WEAPON CVAR: cvar \
- #endif
-*/
-/*
-#define WEP_CLEAN_DUPECHECK(dupecheck) \
- #ifdef WEP_CVAR_##weapon##_##name \
- #undef WEP_CVAR_##weapon##_##name \
- #endif
-*/
-
-#define WEP_ADD_CVAR_MO_PRI(wepname,name) \
- WEP_DUPECHECK(WEP_CVAR_P_##wepname##_##name, autocvar_g_balance_##wepname##_primary_##name)
-
-#define WEP_ADD_CVAR_MO_SEC(wepname,name) \
- WEP_DUPECHECK(WEP_CVAR_S_##wepname##_##name, autocvar_g_balance_##wepname##_secondary_##name)
+#define NODUPE final
+// create cvars for weapon settings
+#define WEP_ADD_CVAR_MO_PRI(wepname,name) NODUPE float autocvar_g_balance_##wepname##_primary_##name;
+#define WEP_ADD_CVAR_MO_SEC(wepname,name) NODUPE float autocvar_g_balance_##wepname##_secondary_##name;
#define WEP_ADD_CVAR_MO_BOTH(wepname,name) \
- WEP_DUPECHECK(WEP_CVAR_P_##wepname##_##name, autocvar_g_balance_##wepname##_primary_##name) \
- WEP_DUPECHECK(WEP_CVAR_S_##wepname##_##name, autocvar_g_balance_##wepname##_secondary_##name)
-
-#define WEP_ADD_CVAR_MO_NONE(wepname,name) \
- WEP_DUPECHECK(WEP_CVAR_##wepname##_##name, autocvar_g_balance_##wepname##_##name)
-
+ NODUPE float autocvar_g_balance_##wepname##_primary_##name; \
+ NODUPE float autocvar_g_balance_##wepname##_secondary_##name;
+#define WEP_ADD_CVAR_MO_NONE(wepname,name) NODUPE float autocvar_g_balance_##wepname##_##name;
#define WEP_ADD_CVAR(wepid,wepname,mode,name) WEP_ADD_CVAR_##mode(wepname, name)
+// create properties for weapon settings
+#define WEP_ADD_PROP(wepid,wepname,prop,name) \
+ .float ##prop; \
+ NODUPE float autocvar_g_balance_##wepname##_##name;
+// read cvars from weapon settings
#define WEP_CVAR(wepname,name) autocvar_g_balance_##wepname##_##name
#define WEP_CVAR_PRI(wepname,name) WEP_CVAR(wepname, primary_##name)
#define WEP_CVAR_SEC(wepname,name) WEP_CVAR(wepname, secondary_##name)
#define WEP_CVAR_BOTH(wepname,mode,name) ((mode == MO_PRI) ? WEP_CVAR_PRI(wepname, name) : WEP_CVAR_SEC(wepname, name))
-
-#define WEP_ADD_PROP(wepid,wepname,prop,name) \
- .float ##prop; \
- WEP_DUPECHECK(WEP_CVAR_##wepname##_##name, autocvar_g_balance_##wepname##_##name)
-
+// set initialization values for weapon settings
#define WEP_SKIPCVAR(unuseda,unusedb,unusedc,unusedd) /* skip cvars */
#define WEP_SET_PROP(wepid,wepname,prop,name) get_weaponinfo(##wepid).##prop = autocvar_g_balance_##wepname##_##name;
#include "all.qh"
+#undef WEP_ADD_CVAR_MO_PRI
+#undef WEP_ADD_CVAR_MO_SEC
+#undef WEP_ADD_CVAR_MO_BOTH
+#undef WEP_ADD_CVAR_MO_NONE
#undef WEP_ADD_CVAR
#undef WEP_ADD_PROP
#undef REGISTER_WEAPON
float autocvar_g_balance_armor_rotlinear;
float autocvar_g_balance_armor_rotstable;
float autocvar_g_balance_armor_start;
-float autocvar_g_balance_rifle_reload_ammo;
+//float autocvar_g_balance_rifle_reload_ammo;
float autocvar_g_balance_cloaked_alpha;
float autocvar_g_balance_contents_damagerate;
float autocvar_g_balance_contents_drowndelay;
float autocvar_g_balance_contents_playerdamage_slime;
float autocvar_g_balance_contents_projectiledamage;
float autocvar_g_balance_crylink_secondary;
-float autocvar_g_balance_crylink_reload_ammo;
+//float autocvar_g_balance_crylink_reload_ammo;
float autocvar_g_balance_damagepush_speedfactor;
float autocvar_g_balance_electro_combo_comboradius;
float autocvar_g_balance_electro_combo_damage;
float autocvar_g_balance_grapplehook_speed_pull;
float autocvar_g_balance_grapplehook_stretch;
float autocvar_g_balance_grapplehook_damagedbycontents;
-float autocvar_g_balance_hagar_reload_ammo;
+//float autocvar_g_balance_hagar_reload_ammo;
float autocvar_g_balance_health_limit;
float autocvar_g_balance_health_regen;
float autocvar_g_balance_health_regenlinear;
float autocvar_g_balance_health_rotlinear;
float autocvar_g_balance_health_rotstable;
float autocvar_g_balance_health_start;
-float autocvar_g_balance_hlac_reload_ammo;
+//float autocvar_g_balance_hlac_reload_ammo;
float autocvar_g_balance_keyhunt_damageforcescale;
float autocvar_g_balance_keyhunt_delay_collect;
float autocvar_g_balance_keyhunt_delay_return;
//float autocvar_g_balance_laser_shockwave_splash_radius;
float autocvar_g_balance_laser_shockwave_spread_max;
float autocvar_g_balance_laser_shockwave_spread_min;
-float autocvar_g_balance_minelayer_reload_ammo;
+//float autocvar_g_balance_minelayer_reload_ammo;
float autocvar_g_balance_minstanex_ammo;
float autocvar_g_balance_minstanex_laser_ammo;
float autocvar_g_balance_minstanex_laser_animtime;
float autocvar_g_balance_minstanex_animtime;
float autocvar_g_balance_minstanex_refire;
float autocvar_g_balance_minstanex_reload_ammo;
-float autocvar_g_balance_nex_reload_ammo;
+//float autocvar_g_balance_nex_reload_ammo;
float autocvar_g_balance_nexball_primary_animtime;
float autocvar_g_balance_nexball_primary_refire;
float autocvar_g_balance_nexball_primary_speed;
float autocvar_g_balance_powerup_strength_selfforce;
float autocvar_g_balance_powerup_strength_time;
float autocvar_g_balance_superweapons_time;
-float autocvar_g_balance_seeker_reload_ammo;
+//float autocvar_g_balance_seeker_reload_ammo;
float autocvar_g_balance_selfdamagepercent;
//float autocvar_g_balance_shotgun_primary_ammo; // WEAPONTODO
//float autocvar_g_balance_shotgun_primary_animtime;
float autocvar_g_balance_teams;
float autocvar_g_balance_teams_prevent_imbalance;
float autocvar_g_balance_teams_scorefactor;
-float autocvar_g_balance_uzi_reload_ammo;
+//float autocvar_g_balance_uzi_reload_ammo;
float autocvar_g_ballistics_density_corpse;
float autocvar_g_ballistics_density_player;
float autocvar_g_ballistics_materialconstant;