31 if (ITEM_IS_LOOT(it) && (autocvar_g_showweaponspawns < 2))
38 NULL, it.origin + (
'0 0 1' * it.maxs.z) * 1.2,
44 wp.wp_extra =
this.m_id;
61 CS(
this).hasweapon_complain_spam =
time + 0.2;
66 sprint(
this,
"Invalid weapon\n");
84 if(wpn == WEP_MINE_LAYER)
85 IL_EACH(
g_mines, it.owner ==
this && it.weaponentity_fld == weaponentity,
118 Weapon_whereis(it, this);
136 float weaponwant, first_valid, prev_valid, switchtonext, switchtolast;
137 switchtonext = switchtolast = 0;
138 first_valid = prev_valid = 0;
143 if(skipmissing || this.(weaponentity).
selectweapon == 0)
154 int wepcomplainindex = 0;
155 bool have_other =
false;
158 WepSet customgroup =
'0 0 0';
166 weaponwant =
stof(
car(rest)); rest =
cdr(rest);
173 if ((it.m_wepset & STAT(WEAPONS, this))
174 || ((it.m_wepset & weaponsInMap) && !(it.spawnflags & WEP_FLAG_HIDDEN)))
184 weaponwant =
stof(
car(rest)); rest =
cdr(rest);
187 if(wep.impulse !=
imp)
191 if(!(
STAT(WEAPONS,
this) & wep.m_wepset))
206 wepcomplainindex = c;
216 first_valid = weaponwant;
217 if(weaponwant == weaponcur)
226 prev_valid = weaponwant;
249 entity w_ent = this.(weaponentity);
250 w_ent.cnt = w_ent.m_switchweapon.m_id;
251 w_ent.m_switchweapon = wep;
252 w_ent.selectweapon = wep.
m_id;
261 if (
STAT(WEAPONS,
this) & set)
263 STAT(WEAPONS,
this) &= ~set;
265 STAT(WEAPONS,
this) |= set;
271 if (ww == WEP_Null)
return;
301 if(!
W_SwitchWeapon(
this, w, weaponentity) &&
CS_CVAR(
this).cvar_cl_weapon_switch_fallback_to_impulse)
358 if (this.(weaponentity) && (this.(weaponentity).
m_weapon != WEP_Null || slot == 0))
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
int impulse
M: impulse : weapon impulse.
virtual void wr_reload()
(SERVER) handles reloading for weapon
virtual void wr_checkammo2()
(SERVER) checks ammo for weapon second
int spawnflags
M: flags : WEPSPAWNFLAG_... combined.
virtual void wr_checkammo1()
(SERVER) checks ammo for weapon primary
const int IT_UNLIMITED_AMMO
vector weaponsInMap
all the weapons actually spawned in the map, does not include filtered items
#define IL_EACH(this, cond, body)
Header file that describes the functions related to game items.
#define FOREACH(list, cond, body)
#define WriteHeader(to, id)
#define REPLICATE_APPLYCHANGE(var, ApplyChange_code)
Allows setting code that will be executed on cvar value changes.
#define REGISTRY_GET(id, i)
bool W_SwitchWeapon(entity this, Weapon w,.entity weaponentity)
float W_GetCycleWeapon(entity this, string weaponorder, float dir, float imp, bool complain, bool skipmissing,.entity weaponentity)
void W_PreviousWeapon(entity this, float list,.entity weaponentity)
void W_SwitchWeapon_Force(Player this, Weapon wep,.entity weaponentity)
void W_NextWeapon(entity this, int list,.entity weaponentity)
void Send_WeaponComplain(entity e, float wpn, float type)
void W_CycleWeapon(entity this, string weaponorder, float dir,.entity weaponentity)
void W_SwitchWeapon_TryOthers(entity this, Weapon w,.entity weaponentity)
void Weapon_whereis(Weapon this, entity cl)
void W_NextWeaponOnImpulse(entity this, float imp,.entity weaponentity)
bool client_hasweapon(entity this, Weapon wpn,.entity weaponentity, float andammo, bool complain)
void W_SwitchToOtherWeapon(entity this,.entity weaponentity)
void W_LastWeapon(entity this,.entity weaponentity)
#define w_getbestweapon(ent, wepent)
bool autocvar_g_weaponswitch_debug
float hasweapon_complain_spam
int autocvar_g_showweaponspawns
string weaponorder_byimpulse
void play2(entity e, string filename)
ClientState CS(Client this)
ERASEABLE string car(string s)
returns first word
ERASEABLE string cdr(string s)
returns all but first word
#define IS_REAL_CLIENT(v)
entity WaypointSprite_Spawn(entity spr, float _lifetime, float maxdistance, entity ref, vector ofs, entity showto, float t, entity own,.entity ownfield, float hideable, entity icon)
#define WepSet_FromWeapon(it)
const int MAX_WEAPONSLOTS
entity weaponentities[MAX_WEAPONSLOTS]
const int WEP_FLAG_MUTATORBLOCKED
const int WEP_FLAG_DUALWIELD
int weaponslot(.entity weaponentity)
const int WEP_FLAG_HIDDEN
entity weaponorder[REGISTRY_MAX(Weapons)]
bool weaponLocked(entity player)