]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Typecheck weaponframe
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 23 Mar 2016 21:28:46 +0000 (08:28 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 23 Mar 2016 21:28:46 +0000 (08:28 +1100)
qcsrc/server/g_damage.qh
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/selection.qh
qcsrc/server/weapons/weaponsystem.qc
qcsrc/server/weapons/weaponsystem.qh

index 38094ef95d85c63e21fbb44c07c79abb9f4b74af..ca5c45b9efd3c01282d965cd812abd15b64c8cb2 100644 (file)
@@ -55,7 +55,7 @@ float IsFlying(entity a);
 void UpdateFrags(entity player, float f);
 
 // NOTE: f=0 means still count as a (positive) kill, but count no frags for it
-void W_SwitchWeapon_Force(entity e, Weapon w);
+void W_SwitchWeapon_Force(Player this, Weapon w);
 entity GiveFrags_randomweapons;
 void GiveFrags (entity attacker, entity targ, float f, int deathtype);
 
index 0d729fd6b331461f0e1ab888736e80326a5f8def..1337a1d71b89a097082565df800e6ea2a2e203ba 100644 (file)
@@ -226,11 +226,12 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa
        return 0;
 }
 
-void W_SwitchWeapon_Force(entity e, Weapon wep)
+void W_SwitchWeapon_Force(Player this, Weapon wep)
 {
-       e.cnt = PS(e).m_switchweapon.m_id;
-       PS(e).m_switchweapon = wep;
-       e.selectweapon = wep.m_id;
+    TC(Player, this); TC(Weapon, wep);
+       this.cnt = PS(this).m_switchweapon.m_id;
+       PS(this).m_switchweapon = wep;
+       this.selectweapon = wep.m_id;
 }
 
 // perform weapon to attack (weaponstate and attack_finished check is here)
index 5800f9415ed20d514d9b6609f62fed106756158d..07f27f5b5d2f17e4c99f298caf3552090130beaa 100644 (file)
@@ -11,7 +11,7 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa
 
 #define w_getbestweapon(ent) Weapons_from(W_GetCycleWeapon(ent, ent.cvar_cl_weaponpriority, 0, -1, false, true))
 
-void W_SwitchWeapon_Force(entity e, Weapon w);
+void W_SwitchWeapon_Force(Player this, Weapon w);
 
 // perform weapon to attack (weaponstate and attack_finished check is here)
 void W_SwitchToOtherWeapon(entity pl);
index 999688b46897cbdd79e51b27e45a1ce7b7e70f1f..0e8ea58762020a4f780050cdacd57d11319c6d01 100644 (file)
@@ -414,8 +414,9 @@ bool forbidWeaponUse(entity player)
 
 .bool hook_switchweapon;
 
-void W_WeaponFrame(entity actor)
+void W_WeaponFrame(Player actor)
 {
+    TC(Player, actor);
        .entity weaponentity = weaponentities[0];  // TODO: unhardcode
        entity this = actor.(weaponentity);
        if (frametime) actor.weapon_frametime = frametime;
index e65ffd67b4a56c9fdb2222991c6a29193addfd05..74d120150fc788e917a591beeb98e2c1f7655818 100644 (file)
@@ -18,7 +18,7 @@ void W_DropEvent(.void(Weapon) event, entity player, float weapon_type, entity w
 
 void W_Reload(entity actor, float sent_ammo_min, Sound sent_sound);
 
-void W_WeaponFrame(entity actor);
+void W_WeaponFrame(Player actor);
 
 float W_WeaponRateFactor();