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);
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)
#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);
.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;
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();