// switch between weapons
void Send_WeaponComplain(entity e, float wpn, float type)
// switch between weapons
void Send_WeaponComplain(entity e, float wpn, float type)
- this.(weaponentity).cnt = this.(weaponentity).m_switchweapon.m_id;
- this.(weaponentity).m_switchweapon = wep;
- this.(weaponentity).selectweapon = wep.m_id;
+ entity w_ent = this.(weaponentity);
+ w_ent.cnt = w_ent.m_switchweapon.m_id;
+ w_ent.m_switchweapon = wep;
+ w_ent.selectweapon = wep.m_id;
- if(!W_SwitchWeapon(this, w, weaponentity) && CS(this).cvar_cl_weapon_switch_fallback_to_impulse)
+ if(!W_SwitchWeapon(this, w, weaponentity) && CS_CVAR(this).cvar_cl_weapon_switch_fallback_to_impulse)
float w;
w = W_GetCycleWeapon(this, weaponorder, dir, -1, 1, true, weaponentity);
if(w > 0)
float w;
w = W_GetCycleWeapon(this, weaponorder, dir, -1, 1, true, weaponentity);
if(w > 0)
- W_SwitchWeapon(this, Weapons_from(w), weaponentity);
+ W_SwitchWeapon(this, REGISTRY_GET(Weapons, w), weaponentity);
- w = W_GetCycleWeapon(this, CS(this).cvar_cl_weaponpriority, +1, imp, 1, (CS(this).cvar_cl_weaponimpulsemode == 0), weaponentity);
+ w = W_GetCycleWeapon(this, CS_CVAR(this).cvar_cl_weaponpriority, +1, imp, 1, (CS_CVAR(this).cvar_cl_weaponimpulsemode == 0), weaponentity);
- W_SwitchWeapon(this, Weapons_from(w), weaponentity);
+ W_SwitchWeapon(this, REGISTRY_GET(Weapons, w), weaponentity);
if(list == 0)
W_CycleWeapon(this, weaponorder_byid, -1, weaponentity);
else if(list == 1)
if(list == 0)
W_CycleWeapon(this, weaponorder_byid, -1, weaponentity);
else if(list == 1)
- W_CycleWeapon(this, CS(this).weaponorder_byimpulse, -1, weaponentity);
+ W_CycleWeapon(this, CS_CVAR(this).weaponorder_byimpulse, -1, weaponentity);
- W_CycleWeapon(this, CS(this).cvar_cl_weaponpriority, -1, weaponentity);
+ W_CycleWeapon(this, CS_CVAR(this).cvar_cl_weaponpriority, -1, weaponentity);
if(list == 0)
W_CycleWeapon(this, weaponorder_byid, +1, weaponentity);
else if(list == 1)
if(list == 0)
W_CycleWeapon(this, weaponorder_byid, +1, weaponentity);
else if(list == 1)
- W_CycleWeapon(this, CS(this).weaponorder_byimpulse, +1, weaponentity);
+ W_CycleWeapon(this, CS_CVAR(this).weaponorder_byimpulse, +1, weaponentity);
- W_CycleWeapon(this, CS(this).cvar_cl_weaponpriority, +1, weaponentity);
+ W_CycleWeapon(this, CS_CVAR(this).cvar_cl_weaponpriority, +1, weaponentity);
}
// previously used if exists and has ammo, (second) best otherwise
void W_LastWeapon(entity this, .entity weaponentity)
{
}
// previously used if exists and has ammo, (second) best otherwise
void W_LastWeapon(entity this, .entity weaponentity)
{
if (client_hasweapon(this, wep, weaponentity, true, false))
W_SwitchWeapon(this, wep, weaponentity);
else
if (client_hasweapon(this, wep, weaponentity, true, false))
W_SwitchWeapon(this, wep, weaponentity);
else