#include "selection.qh"
#include "weaponsystem.qh"
-#include <common/t_items.qh>
-#include <server/items.qh>
+#include <server/items/items.qh>
+#include <server/items/spawning.qh>
#include <common/constants.qh>
#include <common/net_linked.qh>
#include <common/util.qh>
#include <common/items/item.qh>
#include <common/weapons/_all.qh>
+#include <common/replicate.qh>
#include <common/state.qh>
+#include <common/mapobjects/triggers.qh>
#include <common/mutators/mutator/waypoints/waypointsprites.qh>
#include <common/wepent.qh>
{
if (andammo)
{
- if(this.items & IT_UNLIMITED_WEAPON_AMMO)
+ if(this.items & IT_UNLIMITED_AMMO)
{
f = 1;
}
while(rest != "")
{
weaponwant = stof(car(rest)); rest = cdr(rest);
- wep = Weapons_from(weaponwant);
+ wep = REGISTRY_GET(Weapons, weaponwant);
wepset = wep.m_wepset;
if(imp >= 0)
if(wep.impulse != imp)
while(rest != "")
{
weaponwant = stof(car(rest)); rest = cdr(rest);
- wep = Weapons_from(weaponwant);
+ wep = REGISTRY_GET(Weapons, weaponwant);
wepset = wep.m_wepset;
if(imp >= 0)
if(wep.impulse != imp)
return false;
}
}
- else if(!forbidWeaponUse(this) && CS(this).cvar_cl_weapon_switch_reload)
+ else if(!weaponLocked(this) && CS(this).cvar_cl_weapon_switch_reload)
{
entity actor = this;
w.wr_reload(w, actor, weaponentity);
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);
}
void W_NextWeaponOnImpulse(entity this, float imp, .entity weaponentity)
float w;
w = W_GetCycleWeapon(this, CS(this).cvar_cl_weaponpriority, +1, imp, 1, (CS(this).cvar_cl_weaponimpulsemode == 0), weaponentity);
if(w > 0)
- W_SwitchWeapon(this, Weapons_from(w), weaponentity);
+ W_SwitchWeapon(this, REGISTRY_GET(Weapons, w), weaponentity);
}
// next weapon
// previously used if exists and has ammo, (second) best otherwise
void W_LastWeapon(entity this, .entity weaponentity)
{
- Weapon wep = Weapons_from(this.(weaponentity).cnt);
+ Weapon wep = REGISTRY_GET(Weapons, this.(weaponentity).cnt);
if (client_hasweapon(this, wep, weaponentity, true, false))
W_SwitchWeapon(this, wep, weaponentity);
else