From: Samual Lenks Date: Sat, 29 Jun 2013 02:32:55 +0000 (-0400) Subject: Macro macro macro macro macro macro X-Git-Tag: xonotic-v0.8.0~152^2~375 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d48a152767442c473eaa77b16642f901f94e2321;p=xonotic%2Fxonotic-data.pk3dir.git Macro macro macro macro macro macro --- diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index 0ac6363e1..7358d8df4 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -350,6 +350,6 @@ void Ent_DamageInfo(float isNew) w_backoff = -1 * normalize(force); setorigin(self, w_org + w_backoff * 2); // for sound() calls - (get_weaponinfo(hitwep)).weapon_func(WR_IMPACTEFFECT); + WEP_ACTION(hitwep, WR_IMPACTEFFECT); } } diff --git a/qcsrc/common/weapons/weapons.qh b/qcsrc/common/weapons/weapons.qh index 23ae3a45d..b4d1fb7d3 100644 --- a/qcsrc/common/weapons/weapons.qh +++ b/qcsrc/common/weapons/weapons.qh @@ -206,6 +206,10 @@ string W_NumberWeaponOrder(string order); WEPSET_DECLARE_A(WEPBIT_ALL); WEPSET_DECLARE_A(WEPBIT_SUPERWEAPONS); +// other useful macros +#define WEP_ACTION(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest) +#define weapon_action(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest) + // ===================== // Weapon Registration diff --git a/qcsrc/server/weapons/cl_weapons.qh b/qcsrc/server/weapons/cl_weapons.qh index f860dafb5..bd60f4b01 100644 --- a/qcsrc/server/weapons/cl_weapons.qh +++ b/qcsrc/server/weapons/cl_weapons.qh @@ -2,6 +2,3 @@ float weaponswapping; float internalteam; void weapon_defaultspawnfunc(float wpn); - -#define WEP_ACTION(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest) -#define weapon_action(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest) diff --git a/qcsrc/server/weapons/main.qc b/qcsrc/server/weapons/main.qc index 94cefa6cb..1d684c7fb 100644 --- a/qcsrc/server/weapons/main.qc +++ b/qcsrc/server/weapons/main.qc @@ -1085,7 +1085,7 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread) #define W_SETUPPROJECTILEVELOCITY_UP(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), cvar(#s "_speed_up"), cvar(#s "_speed_z"), cvar(#s "_spread"), FALSE) #define W_SETUPPROJECTILEVELOCITY(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), 0, 0, cvar(#s "_spread"), FALSE) -void W_DecreaseAmmo(.float ammo_type, float ammo_use, float ammo_reload) +void W_DecreaseAmmo(.float ammo_type, float ammo_use, float ammo_reload) // WEAPONTODO: why does this have ammo_type? { if((self.items & IT_UNLIMITED_WEAPON_AMMO) && !ammo_reload) return;