]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Macro macro macro macro macro macro
authorSamual Lenks <samual@xonotic.org>
Sat, 29 Jun 2013 02:32:55 +0000 (22:32 -0400)
committerSamual Lenks <samual@xonotic.org>
Sat, 29 Jun 2013 02:32:55 +0000 (22:32 -0400)
qcsrc/client/damage.qc
qcsrc/common/weapons/weapons.qh
qcsrc/server/weapons/cl_weapons.qh
qcsrc/server/weapons/main.qc

index 0ac6363e17582f511bc214c4c55ca1a31ab6b7cf..7358d8df4198885c805602eb11921ab35f7e10dd 100644 (file)
@@ -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);
        }
 }
index 23ae3a45d6262d1768e13fbd78369d3bfef6c9ec..b4d1fb7d30c84bdcc3eb73bf956208208c7b57c6 100644 (file)
@@ -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
index f860dafb52a4ea460eea2bef1528406a04079072..bd60f4b01f14417740da86d4e262a343f5adb0a9 100644 (file)
@@ -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)
index 94cefa6cba060e8f309912afab9dd68b321fe62f..1d684c7fb58b761fda0d3f3690466ea09cfab180 100644 (file)
@@ -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;