]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/weapons/selection.qh
Fix FL_WEAPON flag overlapping FL_JUMPRELEASED. This unintentional change was introdu...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / selection.qh
1 #pragma once
2
3 #include <common/weapons/_all.qh>
4 #include <common/stats.qh>
5
6 int autocvar_g_showweaponspawns;
7 bool autocvar_g_weaponswitch_debug;
8 bool autocvar_g_weaponswitch_debug_alternate;
9
10 .int selectweapon; // last selected weapon of the player
11
12 .WepSet dual_weapons;
13
14 // switch between weapons
15 void Send_WeaponComplain(entity e, float wpn, float type);
16
17 .float hasweapon_complain_spam;
18 bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andammo, bool complain);
19
20 .int weaponcomplainindex;
21 float W_GetCycleWeapon(entity this, string weaponorder, float dir, float imp, float complain, float skipmissing, .entity weaponentity);
22
23 #define w_getbestweapon(ent,wepent) REGISTRY_GET(Weapons, W_GetCycleWeapon(ent, CS_CVAR(ent).cvar_cl_weaponpriority, 0, -1, false, true, wepent))
24
25 void W_SwitchWeapon_Force(Player this, Weapon w, .entity weaponentity);
26
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);
31
32 void W_CycleWeapon(entity this, string weaponorder, float dir, .entity weaponentity);
33
34 void W_NextWeaponOnImpulse(entity this, float imp, .entity weaponentity);
35
36 // next weapon
37 void W_NextWeapon(entity this, float list, .entity weaponentity);
38
39 // prev weapon
40 void W_PreviousWeapon(entity this, float list, .entity weaponentity);
41
42 // previously used if exists and has ammo, (second) best otherwise
43 void W_LastWeapon(entity this, .entity weaponentity);