From: Samual Lenks Date: Sun, 30 Jun 2013 00:04:38 +0000 (-0400) Subject: Actually we can do another macro there too :D X-Git-Tag: xonotic-v0.8.0~152^2~369 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;ds=sidebyside;h=2199d29af6463a7c1e8f1bd3cb5832d6afb48eeb;hp=56ecbeb9b24c18817ed92aa210fd02711c8d9fdf;p=xonotic%2Fxonotic-data.pk3dir.git Actually we can do another macro there too :D --- diff --git a/qcsrc/common/weapons/w_arc.qc b/qcsrc/common/weapons/w_arc.qc index aef5729dc..1be09717e 100644 --- a/qcsrc/common/weapons/w_arc.qc +++ b/qcsrc/common/weapons/w_arc.qc @@ -294,7 +294,7 @@ void ArcInit() arc_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 4); #define WEP_ADD_CVAR(weapon,mode,name) /*nothing*/ - #define WEP_ADD_PROP(weapon,prop,name) get_weaponinfo(WEP_ARC).##prop = autocvar_g_balance_##weapon##_##name; + #define WEP_ADD_PROP(weapon,prop,name) WEP_SET_PROP(WEP_ARC,weapon,prop,name) ARC_SETTINGS(arc) #undef WEP_ADD_CVAR #undef WEP_ADD_PROP diff --git a/qcsrc/common/weapons/w_crylink.qc b/qcsrc/common/weapons/w_crylink.qc index 351babfd4..acc66393a 100644 --- a/qcsrc/common/weapons/w_crylink.qc +++ b/qcsrc/common/weapons/w_crylink.qc @@ -636,7 +636,7 @@ float w_crylink(float req) precache_sound ("weapons/crylink_fire2.wav"); precache_sound ("weapons/crylink_linkjoin.wav"); #define WEP_ADD_CVAR(weapon,mode,name) /*nothing*/ - #define WEP_ADD_PROP(weapon,prop,name) get_weaponinfo(WEP_CRYLINK).##prop = autocvar_g_balance_##weapon##_##name; + #define WEP_ADD_PROP(weapon,prop,name) WEP_SET_PROP(WEP_CRYLINK,weapon,prop,name) CRYLINK_SETTINGS(crylink) #undef WEP_ADD_CVAR #undef WEP_ADD_PROP diff --git a/qcsrc/common/weapons/w_devastator.qc b/qcsrc/common/weapons/w_devastator.qc index e30c8746e..5f889b75e 100644 --- a/qcsrc/common/weapons/w_devastator.qc +++ b/qcsrc/common/weapons/w_devastator.qc @@ -465,7 +465,7 @@ float W_Devastator(float req) } #define WEP_ADD_CVAR(weapon,mode,name) /*nothing*/ - #define WEP_ADD_PROP(weapon,prop,name) get_weaponinfo(WEP_DEVASTATOR).##prop = autocvar_g_balance_##weapon##_##name; + #define WEP_ADD_PROP(weapon,prop,name) WEP_SET_PROP(WEP_DEVASTATOR,weapon,prop,name) ARC_SETTINGS(devastator) #undef WEP_ADD_CVAR #undef WEP_ADD_PROP diff --git a/qcsrc/common/weapons/w_hagar.qc b/qcsrc/common/weapons/w_hagar.qc index 7d8f3d58c..96277ef24 100644 --- a/qcsrc/common/weapons/w_hagar.qc +++ b/qcsrc/common/weapons/w_hagar.qc @@ -444,7 +444,7 @@ float w_hagar(float req) precache_sound ("weapons/hagar_load.wav"); precache_sound ("weapons/hagar_beep.wav"); #define WEP_ADD_CVAR(weapon,mode,name) /*nothing*/ - #define WEP_ADD_PROP(weapon,prop,name) get_weaponinfo(WEP_HAGAR).##prop = autocvar_g_balance_##weapon##_##name; + #define WEP_ADD_PROP(weapon,prop,name) WEP_SET_PROP(WEP_HAGAR,weapon,prop,name) HAGAR_SETTINGS(hagar) #undef WEP_ADD_CVAR #undef WEP_ADD_PROP diff --git a/qcsrc/common/weapons/w_machinegun.qc b/qcsrc/common/weapons/w_machinegun.qc index fe9009412..2b92a8da9 100644 --- a/qcsrc/common/weapons/w_machinegun.qc +++ b/qcsrc/common/weapons/w_machinegun.qc @@ -305,7 +305,7 @@ float w_uzi(float req) precache_model ("models/weapons/h_uzi.iqm"); precache_sound ("weapons/uzi_fire.wav"); #define WEP_ADD_CVAR(weapon,mode,name) /*nothing*/ - #define WEP_ADD_PROP(weapon,prop,name) get_weaponinfo(WEP_UZI).##prop = autocvar_g_balance_##weapon##_##name; + #define WEP_ADD_PROP(weapon,prop,name) WEP_SET_PROP(WEP_UZI,weapon,prop,name) UZI_SETTINGS(uzi) #undef WEP_ADD_CVAR #undef WEP_ADD_PROP diff --git a/qcsrc/common/weapons/w_mortar.qc b/qcsrc/common/weapons/w_mortar.qc index f4b93052b..aa72c88e6 100644 --- a/qcsrc/common/weapons/w_mortar.qc +++ b/qcsrc/common/weapons/w_mortar.qc @@ -388,7 +388,7 @@ float w_glauncher(float req) precache_sound ("weapons/grenade_fire.wav"); #define WEP_ADD_CVAR(weapon,mode,name) /*nothing*/ - #define WEP_ADD_PROP(weapon,prop,name) get_weaponinfo(WEP_GRENADE_LAUNCHER).##prop = autocvar_g_balance_##weapon##_##name; + #define WEP_ADD_PROP(weapon,prop,name) WEP_SET_PROP(WEP_GRENADE_LAUNCHER,weapon,prop,name) MORTAR_SETTINGS(mortar) #undef WEP_ADD_CVAR #undef WEP_ADD_PROP diff --git a/qcsrc/common/weapons/w_nex.qc b/qcsrc/common/weapons/w_nex.qc index 53b7a1c04..821f9e2ec 100644 --- a/qcsrc/common/weapons/w_nex.qc +++ b/qcsrc/common/weapons/w_nex.qc @@ -242,7 +242,7 @@ float w_nex(float req) precache_sound ("weapons/nexwhoosh2.wav"); precache_sound ("weapons/nexwhoosh3.wav"); #define WEP_ADD_CVAR(weapon,mode,name) /*nothing*/ - #define WEP_ADD_PROP(weapon,prop,name) get_weaponinfo(WEP_NEX).##prop = autocvar_g_balance_##weapon##_##name; + #define WEP_ADD_PROP(weapon,prop,name) WEP_SET_PROP(WEP_NEX,weapon,prop,name) NEX_SETTINGS(nex) #undef WEP_ADD_CVAR #undef WEP_ADD_PROP diff --git a/qcsrc/common/weapons/weapons.qh b/qcsrc/common/weapons/weapons.qh index 4bf4a694b..d59bf7a4d 100644 --- a/qcsrc/common/weapons/weapons.qh +++ b/qcsrc/common/weapons/weapons.qh @@ -292,6 +292,8 @@ float WEP_LAST; .float ##prop; \ float autocvar_g_balance_##weapon##_##name; +#define WEP_SET_PROP(wepid,weapon,prop,name) get_weaponinfo(##wepid).##prop = autocvar_g_balance_##weapon##_##name; + #include "all.qh" #undef WEP_ADD_CVAR