float is_dead = (STAT(HEALTH) <= 0);
string reticle_image = string_null;
bool wep_zoomed = false;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
entity wepe = viewmodels[slot];
Weapon wep = wepe.activeweapon;
}
STATIC_INIT(viewmodel) {
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
viewmodels[slot] = new(viewmodel);
}
if(hud == HUD_NORMAL && !spectatee_status)
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
entity wepent = viewmodels[slot];
if(wepent.switchweapon != wepent.activeweapon)
// varying sound pitch
bool have_arc = false;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
entity wepent = viewmodels[slot];
minigame_wasactive = false;
}
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
entity wepent = viewmodels[slot];
// run viewmodel_draw before updating view_angles to the angles calculated by WarpZone_FixView
// viewmodel_draw needs to use the view_angles set by the engine on every CSQC_UpdateView call
if(autocvar_r_drawviewmodel)
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
if(viewmodels[slot].activeweapon)
viewmodel_draw(viewmodels[slot]);
void CSQC_Demo_Camera();
-entity viewmodels[MAX_WEAPONSLOTS];
+entity viewmodels[MAX_WEAPON_PER_SLOT];
vector viewloc_mousepos;
}
else
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
entity player = M_ARGV(0, entity);
STAT(NB_METERSTART, player) = 0;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
STAT(WEAPONS, player.(weaponentity)) = '0 0 0';
if (!(ear.spawnflags & MAGICEAR_TUBA))
return msgin;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(!W_Tuba_HasPlayed(source, weaponentity, ear.message, ear.movedir_x, !(ear.spawnflags & MAGICEAR_TUBA_EXACTPITCH), ear.movedir_y, ear.movedir_z))
if(!MUTATOR_CALLHOOK(MonsterRemove, this))
Send_Effect(EFFECT_ITEM_PICKUP, this.origin, '0 0 0', 1);
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(this.(weaponentity))
#include <common/mutators/mutator/invincibleproj/_mod.inc>
#include <common/mutators/mutator/itemstime/_mod.inc>
#include <common/mutators/mutator/kick_teamkiller/_mod.inc>
+#include <common/mutators/mutator/legendary_akimbo/_mod.inc>
#include <common/mutators/mutator/melee_only/_mod.inc>
#include <common/mutators/mutator/midair/_mod.inc>
#include <common/mutators/mutator/multijump/_mod.inc>
#include <common/mutators/mutator/invincibleproj/_mod.qh>
#include <common/mutators/mutator/itemstime/_mod.qh>
#include <common/mutators/mutator/kick_teamkiller/_mod.qh>
+#include <common/mutators/mutator/legendary_akimbo/_mod.qh>
#include <common/mutators/mutator/melee_only/_mod.qh>
#include <common/mutators/mutator/midair/_mod.qh>
#include <common/mutators/mutator/multijump/_mod.qh>
{
actor.buff_ammo_prev_infitems = (actor.items & IT_UNLIMITED_AMMO);
actor.items |= IT_UNLIMITED_AMMO;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(!actor.(weaponentity))
if(wasactive)
{
actor.items = BITSET(actor.items, IT_UNLIMITED_AMMO, actor.buff_ammo_prev_infitems);
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(!actor.(weaponentity))
{
if(IS_PLAYER(actor))
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(actor.(weaponentity).clip_size)
--- /dev/null
+// generated file; do not modify
+#ifdef SVQC
+ #include <common/mutators/mutator/legendary_akimbo/akimbo.qc>
+#endif
--- /dev/null
+// generated file; do not modify
+#ifdef SVQC
+ #include <common/mutators/mutator/legendary_akimbo/akimbo.qh>
+#endif
--- /dev/null
+#include "akimbo.qh"
+
+//FEATURE: Akimbo mutator for all your dual wielding needs
+
+AUTOCVAR(g_akimbo, bool, false, "Enable Akimbo mutator (requires g_weaponswitch_debug 2)");
+AUTOCVAR(g_akimbo_atspawns, bool, false, "Allow Akimbo items to be collected from item spawnpoints, not just dropped items");
+
+REGISTER_MUTATOR(akimbo, autocvar_g_akimbo && !g_nexball && autocvar_g_weaponswitch_debug == 2);
+
+MUTATOR_HOOKFUNCTION(akimbo, ItemTouch)
+{
+ if(MUTATOR_RETURNVALUE == MUT_ITEMTOUCH_RETURN)
+ return false; // already handled, probably didn't pick it up
+
+ entity item = M_ARGV(0, entity);
+ entity player = M_ARGV(1, entity);
+
+ if((Item_IsLoot(item) || autocvar_g_akimbo_atspawns) && item.weapon &&
+ (STAT(WEAPONS, player) & item.itemdef.m_weapon.m_wepset) && item.owner != player && !(item.itemdef.m_weapon.spawnflags & WEP_FLAG_NOMULTI))
+ PS(player).multi_weapons |= item.itemdef.m_weapon.m_wepset; // dual it up!
+}
+
+MUTATOR_HOOKFUNCTION(akimbo, FilterItem)
+{
+ entity item = M_ARGV(0, entity);
+
+ if((Item_IsLoot(item) || autocvar_g_akimbo_atspawns) && item.weapon && item.owner && IS_PLAYER(item.owner))
+ PS(item.owner).multi_weapons &= ~item.itemdef.m_weapon.m_wepset; // no longer akimbo'd (we don't check blacklist here, no need)
+}
--- /dev/null
+#pragma once
SetResource(it, RES_PLASMA, start_ammo_plasma);
SetResource(it, RES_FUEL, start_ammo_fuel);
STAT(WEAPONS, it) = start_weapons;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(it.(weaponentity).m_weapon == WEP_Null && slot != 0)
// all weapons must be fully loaded when we spawn
if (wpn.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
{
- for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for (int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
this.(weaponentity).(weapon_load[nix_weapon]) = wpn.reloading_ammo;
STAT(WEAPONS, this) |= WEPSET(BLASTER);
STAT(WEAPONS, this) |= wpn.m_wepset;
- for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for (int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if (this.(weaponentity).m_weapon == WEP_Null && slot != 0)
if(!WEP_CVAR(oknex, charge) || !WEP_CVAR(oknex, charge_velocity_rate))
return;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
METHOD(OverkillNex, wr_resetplayer, void(entity thiswep, entity actor))
{
if (WEP_CVAR(oknex, charge)) {
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
actor.(weaponentity).oknex_charge = WEP_CVAR(oknex, charge_start);
bool autocvar_g_overkill_itemwaypoints = true;
-.Weapon ok_lastwep[MAX_WEAPONSLOTS];
+.Weapon ok_lastwep[MAX_WEAPON_PER_SLOT];
/// \brief Returns a random classname of the overkill item.
/// \param[in] prefix Prefix of the cvars that hold probabilities.
ok_DropItem(frag_target, targ);
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
return;
}
// Allow secondary blaster during countdown.
- for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for (int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
Weapon weapon = player.(weaponentity).m_weapon;
{
entity player = M_ARGV(0, entity);
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
entity thiswep = player.(weaponentity);
{
entity frag_target = M_ARGV(2, entity);
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
return;
bool have_hook = false;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
#if defined(CSQC)
entity wepent = viewmodels[slot];
this.wasFlying = false;
if (this.waterlevel >= WATERLEVEL_SWIMMING) return;
if (this.ladder_entity) return;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(this.(weaponentity).hook)
player.view_ofs = STAT(PL_VIEW_OFS, player);
player.event_damage = PlayerDamage;
STAT(HUD, player) = HUD_NORMAL;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++ slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++ slot)
{
.entity weaponentity = weaponentities[slot];
player.(weaponentity).m_switchweapon = vehic.(weaponentity).m_switchweapon;
veh.colormap = pl.colormap;
if(veh.tur_head)
veh.tur_head.colormap = pl.colormap;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
veh.(weaponentity) = new(temp_wepent);
FOREACH_CLIENT(IS_PLAYER(it),
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(it.(weaponentity).hook.aiment == this)
player.event_damage = PlayerDamage;
STAT(HUD, player) = HUD_NORMAL;
player.teleportable = TELEPORT_NORMAL;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
player.(weaponentity).m_switchweapon = gunner.(weaponentity).m_switchweapon;
RemoveGrapplingHooks(player);
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
PHYS_INPUT_BUTTON_ZOOM(this) = false;
PHYS_INPUT_BUTTON_CROUCH(this) = false;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
this.(weaponentity).m_switchweapon = WEP_Null;
for(int j = 4; j > 1; --j) // > 1 as 1 is just center again
{
int taken = 0;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(own.(weaponentity).m_gunalign == j) // we know it can't be ours thanks to the above check
USING(WepSet, vector);
-const int MAX_WEAPONSLOTS = 2;
-.entity weaponentities[MAX_WEAPONSLOTS];
+// TODO: Change this into a multiple weapon slot, it cannot be constant
+int autocvar_g_max_weaponslots = 3;
+
+const int MAX_WEAPON_PER_SLOT = 3;
+.entity weaponentities[MAX_WEAPON_PER_SLOT];
int weaponslot(.entity weaponentity)
{
- for (int i = 0; i < MAX_WEAPONSLOTS; ++i)
+ for (int i = 0; i < autocvar_g_max_weaponslots; ++i)
{
if (weaponentities[i] == weaponentity)
{
const int WEP_FLAG_MUTATORBLOCKED = BIT(8); // hides from impulse 99 etc. (mutators are allowed to clear this flag)
const int WEP_TYPE_MELEE_PRI = BIT(9); // primary attack is melee swing (for animation)
const int WEP_TYPE_MELEE_SEC = BIT(10); // secondary attack is melee swing (for animation)
-const int WEP_FLAG_DUALWIELD = BIT(11); // weapon can be dual wielded
-const int WEP_FLAG_NODUAL = BIT(12); // weapon doesn't work well with dual wielding (fireball etc just explode on fire), doesn't currently prevent anything
+const int WEP_FLAG_MULTIWIELD = BIT(11); // weapon can be dual wielded
+const int WEP_FLAG_NOMULTI = BIT(12); // weapon doesn't work well with dual wielding (fireball etc just explode on fire), doesn't currently prevent anything
const int WEP_FLAG_PENETRATEWALLS = BIT(13); // weapon has high calibur bullets that can penetrate thick walls (WEAPONTODO)
const int WEP_FLAG_BLEED = BIT(14); // weapon pierces and causes bleeding (used for damage effects)
const int WEP_FLAG_NOTRUEAIM = BIT(15); // weapon doesn't aim directly at targets
void Reset_ArcBeam(entity player, vector forward)
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(!player.(weaponentity).arc_beam)
{
actor.arc_overheat = 0;
actor.arc_cooldown = 0;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
actor.(weaponentity).arc_BUTTON_ATCK_prev = false;
void W_Devastator_Unregister(entity this)
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(this.realowner.(weaponentity).lastrocket == this)
vector dv = v_right * -vecs.y + v_up * vecs.z;
- if(!W_DualWielding(this.realowner))
+ if(!W_MultiWielding(this.realowner))
dv = '0 0 0'; // don't override!
velspeed = vlen(this.velocity);
}
METHOD(Devastator, wr_resetplayer, void(entity thiswep, entity actor))
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
actor.(weaponentity).lastrocket = NULL; // stop rocket guiding, no revenge from the grave!
}
METHOD(Fireball, wr_resetplayer, void(entity thiswep, entity actor))
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
actor.(weaponentity).fireball_primarytime = time;
/* spawnfunc */ ATTRIB(Fireball, m_canonical_spawnfunc, string, "weapon_fireball");
/* ammotype */ //ATTRIB(Fireball, ammo_type, Resource, RES_NONE);
/* impulse */ ATTRIB(Fireball, impulse, int, 9);
-/* flags */ ATTRIB(Fireball, spawnflags, int, WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
+/* flags */ ATTRIB(Fireball, spawnflags, int, WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH | WEP_FLAG_NOMULTI);
/* rating */ ATTRIB(Fireball, bot_pickupbasevalue, float, 5000);
/* color */ ATTRIB(Fireball, wpcolor, vector, '1 0.5 0');
/* modelname */ ATTRIB(Fireball, mdl, string, "fireball");
}
METHOD(Hagar, wr_resetplayer, void(entity thiswep, entity actor))
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
actor.(weaponentity).hagar_load = 0;
METHOD(Hook, wr_resetplayer, void(entity thiswep, entity actor))
{
RemoveGrapplingHooks(actor);
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
actor.(weaponentity).hook_time = 0;
{
sound (this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
entity wep = viewmodels[slot];
if(wep.hook == this)
}
METHOD(MineLayer, wr_resetplayer, void(entity thiswep, entity actor))
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
actor.(weaponentity).minelayer_mines = 0;
{
if (spectatee_status || intermission == 1 || intermission == 2 || STAT(HEALTH) <= 0 || WEP_CVAR(porto, secondary)) return;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
entity wepent = viewmodels[slot];
/* spawnfunc */ ATTRIB(PortoLaunch, m_canonical_spawnfunc, string, "weapon_porto");
/* ammotype */ ATTRIB(PortoLaunch, ammo_type, Resource, RES_NONE);
/* impulse */ ATTRIB(PortoLaunch, impulse, int, 0);
-/* flags */ ATTRIB(PortoLaunch, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON | WEP_FLAG_NODUAL | WEP_FLAG_NOTRUEAIM);
+/* flags */ ATTRIB(PortoLaunch, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON | WEP_FLAG_NOMULTI | WEP_FLAG_NOTRUEAIM);
/* rating */ ATTRIB(PortoLaunch, bot_pickupbasevalue, float, 0);
/* color */ ATTRIB(PortoLaunch, wpcolor, vector, '0.5 0.5 0.5');
/* modelname */ ATTRIB(PortoLaunch, mdl, string, "porto");
}
METHOD(Rifle, wr_resetplayer, void(entity thiswep, entity actor))
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
actor.(weaponentity).rifle_accumulator = time - WEP_CVAR(rifle, bursttime);
CLASS(Tuba, Weapon)
/* spawnfunc */ ATTRIB(Tuba, m_canonical_spawnfunc, string, "weapon_tuba");
/* impulse */ ATTRIB(Tuba, impulse, int, 1);
-/* flags */ ATTRIB(Tuba, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL | WEP_FLAG_NOTRUEAIM);
+/* flags */ ATTRIB(Tuba, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH | WEP_FLAG_NOMULTI | WEP_FLAG_NOTRUEAIM);
/* rating */ ATTRIB(Tuba, bot_pickupbasevalue, float, 2000);
/* color */ ATTRIB(Tuba, wpcolor, vector, '0 1 0');
/* modelname */ ATTRIB(Tuba, mdl, string, "tuba");
/* spawnfunc */ ATTRIB(Vaporizer, m_canonical_spawnfunc, string, "weapon_vaporizer");
/* ammotype */ ATTRIB(Vaporizer, ammo_type, Resource, RES_CELLS);
/* impulse */ ATTRIB(Vaporizer, impulse, int, 7);
-/* flags */ ATTRIB(Vaporizer, spawnflags, int, WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN | WEP_FLAG_NODUAL);
+/* flags */ ATTRIB(Vaporizer, spawnflags, int, WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN | WEP_FLAG_NOMULTI);
/* rating */ ATTRIB(Vaporizer, bot_pickupbasevalue, float, 10000);
/* color */ ATTRIB(Vaporizer, wpcolor, vector, '0.5 1 1');
/* modelname */ ATTRIB(Vaporizer, mdl, string, "minstanex");
if(!WEP_CVAR(vortex, charge) || !WEP_CVAR(vortex, charge_velocity_rate))
return;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
METHOD(Vortex, wr_resetplayer, void(entity thiswep, entity actor))
{
if (WEP_CVAR(vortex, charge)) {
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
actor.(weaponentity).vortex_charge = WEP_CVAR(vortex, charge_start);
havocbot_chooseenemy(this);
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(this.(weaponentity).m_weapon != WEP_Null || slot == 0)
}
else
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
Weapon w = this.(weaponentity).m_weapon;
// if the bot is not attacking, consider reloading weapons
if (!(this.aistatus & AI_STATUS_ATTACKING))
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
{
if(this.velocity.z < 0)
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
bool success = false;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(this.(weaponentity).m_weapon == WEP_Null && slot != 0)
//this.spawnpoint_targ = NULL; // keep it so they can return to where they were?
this.weaponmodel = "";
- for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for (int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
this.weaponentities[slot] = NULL;
}
}
SetSpectatee_status(this, 0);
- PS(this).dual_weapons = '0 0 0';
+ PS(this).multi_weapons = '0 0 0';
if(STAT(WEAPONS, this) & WEPSET_SUPERWEAPONS)
StatusEffects_apply(STATUSEFFECT_Superweapons, this, time + autocvar_g_balance_superweapons_time, 0);
CS(this).startplaytime = time;
}
- for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for (int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
CL_SpawnWeaponentity(this, weaponentity);
it.wr_resetplayer(it, this);
// reload all reloadable weapons
if (it.spawnflags & WEP_FLAG_RELOADABLE) {
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
this.(weaponentity).weapon_load[it.m_id] = it.reloading_ammo;
delete(spot); // usefull for checking if there are spawnpoints, that let drop through the floor
}
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
entity w_ent = this.(weaponentity);
if (CS(this).impulse) ImpulseCommands(this);
W_ResetGunAlign(this, CS_CVAR(this).cvar_cl_gunalign);
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
W_WeaponFrame(this, weaponentity);
// these are required to fix the spectator bug with arc
if(old_spectatee)
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(old_spectatee.(weaponentity).arc_beam)
}
if(spectatee)
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(spectatee.(weaponentity).arc_beam)
}
.string shootfromfixedorigin;
-.bool dualwielding_prev;
+.bool MULTIWIELDing_prev;
bool PlayerThink(entity this)
{
if (game_stopped || intermission_running) {
// reset gun alignment when dual wielding status changes
// to ensure guns are always aligned right and left
- bool dualwielding = W_DualWielding(this);
- if(this.dualwielding_prev != dualwielding)
+ bool MULTIWIELDing = W_MultiWielding(this);
+ if(this.MULTIWIELDing_prev != MULTIWIELDing)
{
W_ResetGunAlign(this, CS_CVAR(this).cvar_cl_gunalign);
- this.dualwielding_prev = dualwielding;
+ this.MULTIWIELDing_prev = MULTIWIELDing;
}
// LordHavoc: allow firing on move frames (sub-ticrate), this gives better timing on slow servers
//if(frametime)
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(WEP_CVAR(vortex, charge_always))
{
// WEAPONTODO: Add a weapon request for this
// rot vortex charge to the charge limit
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if (WEP_CVAR(vortex, charge_rot_rate) && this.(weaponentity).vortex_charge > WEP_CVAR(vortex, charge_limit) && this.(weaponentity).vortex_charge_rottime < time)
// WEAPONTODO: Add weapon request for this
if (!zoomstate_set) {
bool wep_zoomed = false;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
Weapon thiswep = this.(weaponentity).m_weapon;
// custom
- ATTRIB(Player, dual_weapons, vector, this.dual_weapons); // TODO: actually WepSet!
+ ATTRIB(Player, multi_weapons, vector, this.multi_weapons); // TODO: actually WepSet!
ATTRIB(Player, itemkeys, int, this.itemkeys);
ATTRIB(Player, ballistics_density, float, this.ballistics_density);
string AppendItemcodes(string s, entity player)
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
int w = player.(weaponentity).m_weapon.m_id;
FOREACH_CLIENT(IS_PLAYER(it),
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(it.(weaponentity).hook.aiment == targ)
FOREACH_CLIENT(IS_PLAYER(it),
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(it.(weaponentity).hook.aiment == targ)
if(IS_PLAYER(targ) && damage > 0 && attacker)
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity went = weaponentities[slot];
if(targ.(went).hook && targ.(went).hook.aiment == attacker)
if(pl.move_movetype == MOVETYPE_FLY)
set_movetype(pl, MOVETYPE_WALK);
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(!pl.(weaponentity))
this.impulse = imp;
return;
}
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
W_NextWeaponOnImpulse(this, number, weaponentity);
this.impulse = imp;
return;
}
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
W_CycleWeapon(this, CS_CVAR(this).cvar_cl_weaponpriorities[number], dir, weaponentity);
this.impulse = imp;
return;
}
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
W_SwitchWeapon_TryOthers(this, REGISTRY_GET(Weapons, WEP_FIRST + number), weaponentity);
this.impulse = IMP_weapon_next_byid.impulse;
return;
}
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
W_NextWeapon(this, 0, weaponentity);
this.impulse = IMP_weapon_prev_byid.impulse;
return;
}
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
W_PreviousWeapon(this, 0, weaponentity);
this.impulse = IMP_weapon_next_bygroup.impulse;
return;
}
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
W_NextWeapon(this, 1, weaponentity);
this.impulse = IMP_weapon_prev_bygroup.impulse;
return;
}
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
W_PreviousWeapon(this, 1, weaponentity);
this.impulse = IMP_weapon_next_bypriority.impulse;
return;
}
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
W_NextWeapon(this, 2, weaponentity);
this.impulse = IMP_weapon_prev_bypriority.impulse;
return;
}
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
W_PreviousWeapon(this, 2, weaponentity);
{
if (this.vehicle) return;
if (IS_DEAD(this)) return;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
W_LastWeapon(this, weaponentity);
{
if (this.vehicle) return;
if (IS_DEAD(this)) return;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
W_SwitchWeapon(this, w_getbestweapon(this, weaponentity), weaponentity);
{
if (this.vehicle) return;
if (IS_DEAD(this)) return;
- bool is_dualwielding = W_DualWielding(this);
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ bool is_multiwielding = W_MultiWielding(this);
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
vector md = this.(weaponentity).movedir;
vector vecs = ((md.x > 0) ? md : '0 0 0');
vector dv = v_right * -vecs.y;
- if(!is_dualwielding)
+ if(!is_multiwielding)
dv = '0 0 0'; // don't override!
W_ThrowWeapon(this, weaponentity, W_CalculateProjectileVelocity(this, this.velocity, v_forward * 750, false), dv, true);
if (IS_DEAD(this)) return;
if (weaponLocked(this)) return;
entity actor = this;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
Weapon w = this.(weaponentity).m_weapon;
{
e.autoscreenshot = time + 0.8; // used for autoscreenshot
SetResourceExplicit(e, RES_HEALTH, -2342); // health in the first intermission phase
- for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for (int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(e.(weaponentity))
if(CS_CVAR(player).cvar_cl_autoswitch)
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(player.(weaponentity).m_weapon != WEP_Null || slot == 0)
if(wp & (it.m_wepset))
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(player.(weaponentity).m_weapon != WEP_Null || slot == 0)
// crude hack to enforce switching weapons
if(g_cts && item.itemdef.instanceOfWeaponPickup && !CS_CVAR(player).cvar_cl_cts_noautoswitch)
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(player.(weaponentity).m_weapon != WEP_Null || slot == 0)
if(_switchweapon)
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(_switchweapon & BIT(slot))
if(CS_CVAR(e).cvar_cl_autoswitch)
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(e.(weaponentity).m_weapon != WEP_Null || slot == 0)
StatusEffects_update(e);
}
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(e.(weaponentity).m_weapon != WEP_Null || slot == 0)
if(_switchweapon)
{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(_switchweapon & BIT(slot))
// check for falling damage
bool have_hook = false;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(this.(weaponentity).hook && this.(weaponentity).hook.state)
excess = max(0, damage - take - save);
//Weapon wep = this.(weaponentity).m_weapon;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity went = weaponentities[slot];
if(!this.(went))
// clear waypoints
WaypointSprite_PlayerDead(this);
// throw a weapon
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity went = weaponentities[slot];
SpawnThrownWeapon(this, this.origin + (this.mins + this.maxs) * 0.5, this.(went).m_weapon, went);
FOREACH(Weapons, it != WEP_Null,
{
it.wr_resetplayer(it, this);
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
ATTACK_FINISHED_FOR(this, it.m_id, slot) = 0;
}
if(it != o || time >= this.portal_activatetime)
Portal_Think_TryTeleportPlayer(this, it, g, o);
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(it.(weaponentity).hook)
#include <server/mutators/_mod.qh>
#include <server/weapons/csqcprojectile.qh>
-bool W_DualWielding(entity player)
+bool W_MultiWielding(entity player)
{
int held_weapons = 0;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if(player.(weaponentity) && player.(weaponentity).m_switchweapon != WEP_Null)
float autocvar_sv_strengthsound_antispam_refire_threshold;
float autocvar_sv_strengthsound_antispam_time;
-bool W_DualWielding(entity player);
+bool W_MultiWielding(entity player);
void W_GiveWeapon (entity e, float wep);
void W_PlayStrengthSound(entity player);
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception);
sprint(this, "Invalid weapon\n");
return false;
}
- if (autocvar_g_weaponswitch_debug == 2 && weaponslot(weaponentity) > 0 && !(wpn.spawnflags & WEP_FLAG_DUALWIELD) && !(PS(this).dual_weapons & wpn.m_wepset))
+ if (autocvar_g_weaponswitch_debug == 2 && weaponslot(weaponentity) > 0 && !(wpn.spawnflags & WEP_FLAG_MULTIWIELD) && !(PS(this).multi_weapons & wpn.m_wepset))
return false; // no complaints needed
if (STAT(WEAPONS, this) & WepSet_FromWeapon(wpn))
{
// fix switchweapon (needed when spectating is disabled, as PutClientInServer comes too early)
REPLICATE_APPLYCHANGE("cl_weaponpriority",
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if (this.(weaponentity) && (this.(weaponentity).m_weapon != WEP_Null || slot == 0))
.int selectweapon; // last selected weapon of the player
-.WepSet dual_weapons;
+.WepSet multi_weapons;
// switch between weapons
void Send_WeaponComplain(entity e, float wpn, float type);
tracebox(w_shotorg, mi, ma, w_shotorg + forward * (vecs.x + nudge), MOVE_NORMAL, ent);
w_shotorg = trace_endpos - forward * nudge;
// calculate the shotdir from the chosen shotorg
- if(W_DualWielding(ent))
+ if(W_MultiWielding(ent))
w_shotdir = s_forward;
else
w_shotdir = normalize(w_shotend - w_shotorg);
ent.punchangle_x = recoil * -1;
if (snd != SND_Null) {
- sound(ent, chan, snd, (W_DualWielding(ent) ? VOL_BASE * 0.7 : VOL_BASE), ATTN_NORM);
+ sound(ent, chan, snd, (W_MultiWielding(ent) ? VOL_BASE * 0.7 : VOL_BASE), ATTN_NORM);
W_PlayStrengthSound(ent);
}
float arate = W_WeaponRateFactor(actor);
ATTACK_FINISHED(actor, weaponentity) = ATTACK_FINISHED(actor, weaponentity) + attacktime * arate;
- if(autocvar_g_weaponswitch_debug_alternate && W_DualWielding(actor))
+ if(autocvar_g_weaponswitch_debug_alternate && W_MultiWielding(actor))
{
int slot = weaponslot(weaponentity);
- for(int wepslot = 0; wepslot < MAX_WEAPONSLOTS; ++wepslot)
+ for(int wepslot = 0; wepslot < autocvar_g_max_weaponslots; ++wepslot)
{
if(slot == wepslot)
continue;
continue; // still cooling down!
if (ATTACK_FINISHED(actor, wepent) < time - actor.(wepent).weapon_frametime * 1.5)
ATTACK_FINISHED(actor, wepent) = time;
- ATTACK_FINISHED(actor, wepent) = ATTACK_FINISHED(actor, wepent) + (attacktime * arate) / MAX_WEAPONSLOTS;
+ ATTACK_FINISHED(actor, wepent) = ATTACK_FINISHED(actor, wepent) + (attacktime * arate) / autocvar_g_max_weaponslots;
}
}
}
void W_ResetGunAlign(entity player, int preferred_alignment)
{
- if(W_DualWielding(player))
+ if(W_MultiWielding(player))
preferred_alignment = 3; // right align, the second gun will default to left
// clear current weapon slots' alignments so we can redo the calculations!
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if (player.(weaponentity))
}
// now set the new values
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ for(int slot = 0; slot < autocvar_g_max_weaponslots; ++slot)
{
.entity weaponentity = weaponentities[slot];
if (player.(weaponentity))
entity wep1 = actor.(wepe1);
this.m_switchweapon = wep1.m_switchweapon;
entity store = IS_PLAYER(actor) ? PS(actor) : actor;
- if(!(this.m_switchweapon.spawnflags & WEP_FLAG_DUALWIELD) && !(store.dual_weapons & wep1.m_switchweapon.m_wepset))
+ if(!(this.m_switchweapon.spawnflags & WEP_FLAG_MULTIWIELD) && !(store.multi_weapons & wep1.m_switchweapon.m_wepset))
{
this.m_weapon = WEP_Null;
this.m_switchingweapon = WEP_Null;
.int old_clip_load;
.int clip_size;
-.float attack_finished_for[REGISTRY_MAX(Weapons) * MAX_WEAPONSLOTS];
-.float attack_finished_single[MAX_WEAPONSLOTS];
+.float attack_finished_for[REGISTRY_MAX(Weapons) * MAX_WEAPON_PER_SLOT];
+.float attack_finished_single[MAX_WEAPON_PER_SLOT];
#if INDEPENDENT_ATTACK_FINISHED
-#define ATTACK_FINISHED_FOR(ent, w, slot) ((ent).(attack_finished_for[((w) - WEP_FIRST) * MAX_WEAPONSLOTS + (slot)]))
+#define ATTACK_FINISHED_FOR(ent, w, slot) ((ent).(attack_finished_for[((w) - WEP_FIRST) * autocvar_g_max_weaponslots + (slot)]))
#else
#define ATTACK_FINISHED_FOR(ent, w, slot) ((ent).attack_finished_single[slot])
#endif