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);
}
}
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
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)
#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;