3 #include <common/weapons/_all.qh>
4 #include <common/stats.qh>
6 int autocvar_g_showweaponspawns;
7 bool autocvar_g_weaponswitch_debug;
8 bool autocvar_g_weaponswitch_debug_alternate;
10 .int selectweapon; // last selected weapon of the player
14 // switch between weapons
15 void Send_WeaponComplain(entity e, float wpn, float type);
17 .float hasweapon_complain_spam;
18 bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andammo, bool complain);
20 .int weaponcomplainindex;
21 float W_GetCycleWeapon(entity this, string weaponorder, float dir, float imp, float complain, float skipmissing, .entity weaponentity);
23 #define w_getbestweapon(ent,wepent) REGISTRY_GET(Weapons, W_GetCycleWeapon(ent, CS_CVAR(ent).cvar_cl_weaponpriority, 0, -1, false, true, wepent))
25 void W_SwitchWeapon_Force(Player this, Weapon w, .entity weaponentity);
27 // perform weapon to attack (weaponstate and attack_finished check is here)
28 void W_SwitchToOtherWeapon(entity this, .entity weaponentity);
29 bool W_SwitchWeapon(entity this, Weapon imp, .entity weaponentity); // returns false if the player does not have the weapon
30 void W_SwitchWeapon_TryOthers(entity this, Weapon imp, .entity weaponentity);
32 void W_CycleWeapon(entity this, string weaponorder, float dir, .entity weaponentity);
34 void W_NextWeaponOnImpulse(entity this, float imp, .entity weaponentity);
37 void W_NextWeapon(entity this, float list, .entity weaponentity);
40 void W_PreviousWeapon(entity this, float list, .entity weaponentity);
42 // previously used if exists and has ammo, (second) best otherwise
43 void W_LastWeapon(entity this, .entity weaponentity);