ball.nextthink = time + autocvar_g_nexball_basketball_delay_hold;
}
- plyr.(weaponentity).weapons = plyr.weapons;
+ plyr.(weaponentity).weapons = STAT(WEAPONS, plyr);
plyr.m_switchweapon = plyr.(weaponentity).m_weapon;
- plyr.weapons = WEPSET(NEXBALL);
+ STAT(WEAPONS, plyr) = WEPSET(NEXBALL);
Weapon w = WEP_NEXBALL;
w.wr_resetplayer(w, plyr);
plyr.(weaponentity).m_switchweapon = WEP_NEXBALL;
if(player.(weaponentity).weapons)
{
- player.weapons = player.(weaponentity).weapons;
+ STAT(WEAPONS, player) = player.(weaponentity).weapons;
Weapon w = WEP_NEXBALL;
w.wr_resetplayer(w, player);
player.(weaponentity).m_switchweapon = player.m_switchweapon;
}
if (nexball_mode & NBM_BASKETBALL)
- player.weapons |= WEPSET(NEXBALL);
+ STAT(WEAPONS, player) |= WEPSET(NEXBALL);
else
- player.weapons = '0 0 0';
+ STAT(WEAPONS, player) = '0 0 0';
return false;
}
// Needs weapons?
int c = 0;
FOREACH(Weapons, it != WEP_Null, {
- if(this.weapons & (it.m_wepset))
+ if(STAT(WEAPONS, this) & (it.m_wepset))
if(++c >= 4)
break;
});
{
entity player = M_ARGV(0, entity);
- if (player.offhand != OFFHAND_NADE || (player.weapons & WEPSET(HOOK)) || autocvar_g_nades_override_dropweapon) {
+ if (player.offhand != OFFHAND_NADE || (STAT(WEAPONS, player) & WEPSET(HOOK)) || autocvar_g_nades_override_dropweapon) {
nades_CheckThrow(player);
return true;
}
if (!IS_PLAYER(player)) { return; }
- if (player.nade && (player.offhand != OFFHAND_NADE || (player.weapons & WEPSET(HOOK)))) OFFHAND_NADE.offhand_think(OFFHAND_NADE, player, player.nade_altbutton);
+ if (player.nade && (player.offhand != OFFHAND_NADE || (STAT(WEAPONS, player) & WEPSET(HOOK)))) OFFHAND_NADE.offhand_think(OFFHAND_NADE, player, player.nade_altbutton);
entity held_nade = player.nade;
if (held_nade)
SetResourceAmount(it, RESOURCE_CELLS, start_ammo_cells);
SetResourceAmount(it, RESOURCE_PLASMA, start_ammo_plasma);
SetResourceAmount(it, RESOURCE_FUEL, start_ammo_fuel);
- it.weapons = start_weapons;
+ STAT(WEAPONS, it) = start_weapons;
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
.entity weaponentity = weaponentities[slot];
this.nix_nextincr = time + autocvar_g_balance_nix_incrtime;
}
- this.weapons = '0 0 0';
+ STAT(WEAPONS, this) = '0 0 0';
if(g_nix_with_blaster)
- this.weapons |= WEPSET(BLASTER);
- this.weapons |= e.m_wepset;
+ STAT(WEAPONS, this) |= WEPSET(BLASTER);
+ STAT(WEAPONS, this) |= e.m_wepset;
Weapon w = Weapons_from(nix_weapon);
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
continue;
FOREACH(Weapons, it != WEP_Null, {
- if(frag_target.weapons & WepSet_FromWeapon(it))
+ if(STAT(WEAPONS, frag_target) & WepSet_FromWeapon(it))
if(frag_target.(weaponentity).m_weapon != it)
if(W_IsWeaponThrowable(frag_target, it.m_id))
W_ThrowNewWeapon(frag_target, it.m_id, false, CENTER_OR_VIEWOFS(frag_target), randomvec() * 175 + '0 0 325', weaponentity);
if (!g_weaponarena_random) return;
entity player = M_ARGV(0, entity);
- if (g_weaponarena_random_with_blaster) player.weapons &= ~WEPSET(BLASTER);
+ if (g_weaponarena_random_with_blaster) STAT(WEAPONS, player) &= ~WEPSET(BLASTER);
W_RandomWeapons(player, g_weaponarena_random);
- if (g_weaponarena_random_with_blaster) player.weapons |= WEPSET(BLASTER);
+ if (g_weaponarena_random_with_blaster) STAT(WEAPONS, player) |= WEPSET(BLASTER);
}
return true;
}
-/*
-float Item_Customize()
-{
- if(this.spawnshieldtime)
- return true;
- if(this.weapons & ~other.weapons)
- {
- this.colormod = '0 0 0';
- this.glowmod = this.colormod;
- this.alpha = 0.5 + 0.5 * g_ghost_items; // halfway more alpha
- return true;
- }
- else
- {
- if(g_ghost_items)
- {
- this.colormod = stov(autocvar_g_ghost_items_color);
- this.glowmod = this.colormod;
- this.alpha = g_ghost_items;
- return true;
- }
- else
- return false;
- }
-}
-*/
-
void Item_Show (entity e, float mode)
{
e.effects &= ~(EF_ADDITIVE | EF_STARDUST | EF_FULLBRIGHT | EF_NODEPTHTEST);
FOREACH(Weapons, it != WEP_Null,
{
// Finding a weapon which player doesn't have.
- if (!(receiver.weapons & it.m_wepset) && (it.netname == weapon))
+ if (!(STAT(WEAPONS, receiver) & it.m_wepset) && (it.netname == weapon))
{
RandomSelection_AddEnt(it, 1, 1);
break;
{
return;
}
- receiver.weapons |= RandomSelection_chosen_ent.m_wepset;
+ STAT(WEAPONS, receiver) |= RandomSelection_chosen_ent.m_wepset;
if (RandomSelection_chosen_ent.ammo_type == RESOURCE_NONE)
{
continue;
if(player.(weaponentity).m_switchweapon == w_getbestweapon(player, weaponentity))
_switchweapon |= BIT(slot);
- if(!(player.weapons & WepSet_FromWeapon(player.(weaponentity).m_switchweapon)))
+ if(!(STAT(WEAPONS, player) & WepSet_FromWeapon(player.(weaponentity).m_switchweapon)))
_switchweapon |= BIT(slot);
}
}
{
WepSet w;
w = item.weapons;
- w &= ~player.weapons;
+ w &= ~STAT(WEAPONS, player);
if (w || (item.spawnshieldtime && item.pickup_anyway > 0))
{
float weapon_pickupevalfunc(entity player, entity item)
{
// See if I have it already
- if(player.weapons & item.weapons)
+ if(STAT(WEAPONS, player) & item.weapons)
{
// If I can pick it up
if(!item.spawnshieldtime)
// reduce weapon value if bot already got a good arsenal
float c = 1;
int weapons_value = 0;
- FOREACH(Weapons, it != WEP_Null && (player.weapons & it.m_wepset), {
+ FOREACH(Weapons, it != WEP_Null && (STAT(WEAPONS, player) & it.m_wepset), {
weapons_value += it.bot_pickupbasevalue;
});
c -= bound(0, weapons_value / 20000, 1) * 0.5;
else
{
FOREACH(Weapons, it != WEP_Null, {
- if(!(player.weapons & (it.m_wepset)))
+ if(!(STAT(WEAPONS, player) & (it.m_wepset)))
continue;
switch(it.ammo_type)
{
WepSet v0, v1;
WepSet s = WepSet_FromWeapon(Weapons_from(wpn));
- v0 = (e.weapons & s);
+ v0 = (STAT(WEAPONS, e) & s);
switch(op)
{
case OP_SET:
if(val > 0)
- e.weapons |= s;
+ STAT(WEAPONS, e) |= s;
else
- e.weapons &= ~s;
+ STAT(WEAPONS, e) &= ~s;
break;
case OP_MIN:
case OP_PLUS:
if(val > 0)
- e.weapons |= s;
+ STAT(WEAPONS, e) |= s;
break;
case OP_MAX:
if(val <= 0)
- e.weapons &= ~s;
+ STAT(WEAPONS, e) &= ~s;
break;
case OP_MINUS:
if(val > 0)
- e.weapons &= ~s;
+ STAT(WEAPONS, e) &= ~s;
break;
}
- v1 = (e.weapons & s);
+ v1 = (STAT(WEAPONS, e) & s);
return (v0 != v1);
}
FOREACH(Weapons, it != WEP_Null, {
POSTGIVE_WEAPON(e, it, SND_WEAPONPICKUP, SND_Null);
if(!(save_weapons & (it.m_wepset)))
- if(e.weapons & (it.m_wepset))
+ if(STAT(WEAPONS, e) & (it.m_wepset))
it.wr_init(it);
});
POSTGIVE_VALUE(e, strength_finished, 1, SND_POWERUP, SND_POWEROFF);
POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, SND_MEGAHEALTH, SND_Null);
if(e.superweapons_finished <= 0)
- if(e.weapons & WEPSET_SUPERWEAPONS)
+ if(STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS)
e.superweapons_finished = autocvar_g_balance_superweapons_time;
if(e.strength_finished <= 0)
{
.entity weaponentity = weaponentities[slot];
if(e.(weaponentity).m_weapon != WEP_Null || slot == 0)
- if(!(e.weapons & WepSet_FromWeapon(e.(weaponentity).m_switchweapon)))
+ if(!(STAT(WEAPONS, e) & WepSet_FromWeapon(e.(weaponentity).m_switchweapon)))
_switchweapon |= BIT(slot);
}
void GiveRot(entity e, float v0, float v1, .float rotfield, float rottime, .float regenfield, float regentime);
-#define PREGIVE_WEAPONS(e) WepSet save_weapons; save_weapons = e.weapons
+#define PREGIVE_WEAPONS(e) WepSet save_weapons; save_weapons = STAT(WEAPONS, e)
#define PREGIVE(e,f) float save_##f; save_##f = (e).f
-#define POSTGIVE_WEAPON(e,b,snd_incr,snd_decr) GiveSound((e), !!(save_weapons & WepSet_FromWeapon(b)), !!(e.weapons & WepSet_FromWeapon(b)), 0, snd_incr, snd_decr)
+#define POSTGIVE_WEAPON(e,b,snd_incr,snd_decr) GiveSound((e), !!(save_weapons & WepSet_FromWeapon(b)), !!(STAT(WEAPONS, e) & WepSet_FromWeapon(b)), 0, snd_incr, snd_decr)
#define POSTGIVE_BIT(e,f,b,snd_incr,snd_decr) GiveSound((e), save_##f & (b), (e).f & (b), 0, snd_incr, snd_decr)
#define POSTGIVE_VALUE(e,f,t,snd_incr,snd_decr) GiveSound((e), save_##f, (e).f, t, snd_incr, snd_decr)
#define POSTGIVE_VALUE_ROT(e,f,t,rotfield,rottime,regenfield,regentime,snd_incr,snd_decr) GiveRot((e), save_##f, (e).f, rotfield, rottime, regenfield, regentime); GiveSound((e), save_##f, (e).f, t, snd_incr, snd_decr)
void W_RandomWeapons(entity e, int n)
{
+#ifdef SVQC
+ WepSet remaining = STAT(WEAPONS, e);
+#else
WepSet remaining = e.weapons;
+#endif
WepSet result = '0 0 0';
for (int j = 0; j < n; ++j)
{
result |= WepSet_FromWeapon(w);
remaining &= ~WepSet_FromWeapon(w);
}
+#ifdef SVQC
+ STAT(WEAPONS, e) = result;
+#else
e.weapons = result;
+#endif
}
string GetAmmoPicture(int ammotype)
this.realowner.porto_current = NULL;
- if(this.cnt < 0 && !failhard && this.realowner.playerid == this.playerid && !IS_DEAD(this.realowner) && !(this.realowner.weapons & WEPSET(PORTO)))
+ if(this.cnt < 0 && !failhard && this.realowner.playerid == this.playerid && !IS_DEAD(this.realowner) && !(STAT(WEAPONS, this.realowner) & WEPSET(PORTO)))
{
setsize(this, '-16 -16 0', '16 16 32');
setorigin(this, this.origin + trace_plane_normal);
this.aistatus |= AI_STATUS_ATTACKING;
this.aistatus &= ~AI_STATUS_ROAMING;
- if(this.weapons)
+ if(STAT(WEAPONS, this))
{
if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(this))
{
if(this.(weaponentity).clip_load >= 0) // only if we're not reloading a weapon already
{
FOREACH(Weapons, it != WEP_Null, {
- if((this.weapons & (it.m_wepset)) && (it.spawnflags & WEP_FLAG_RELOADABLE) && (this.(weaponentity).weapon_load[it.m_id] < it.reloading_ammo))
+ if((STAT(WEAPONS, this) & (it.m_wepset)) && (it.spawnflags & WEP_FLAG_RELOADABLE) && (this.(weaponentity).weapon_load[it.m_id] < it.reloading_ammo))
{
this.(weaponentity).m_switchweapon = it;
break;
// I want to do a second scan if no enemy was found or I don't have weapons
// TODO: Perform the scan when using the rifle (requires changes on the rifle code)
- if(best || this.weapons) // || this.weapon == WEP_RIFLE.m_id
+ if(best || STAT(WEAPONS, this)) // || this.weapon == WEP_RIFLE.m_id
break;
if(scan_transparent)
break;
{
if (item.health && player.health <= this.health) {return true;}
if (item.armorvalue && player.armorvalue <= this.armorvalue) {return true;}
- if (item.weapons && !(player.weapons & item.weapons)) {return true;}
+ if (item.weapons && !(STAT(WEAPONS, player) & item.weapons)) {return true;}
if (item.ammo_shells && player.ammo_shells <= this.ammo_shells) {return true;}
if (item.ammo_nails && player.ammo_nails <= this.ammo_nails) {return true;}
if (item.ammo_rockets && player.ammo_rockets <= this.ammo_rockets) {return true;}
this.personal.ammo_fuel = this.ammo_fuel;
this.personal.health = max(1, this.health);
this.personal.armorvalue = this.armorvalue;
- this.personal.weapons = this.weapons;
+ this.personal.weapons = STAT(WEAPONS, this);
this.personal.items = this.items;
this.personal.pauserotarmor_finished = this.pauserotarmor_finished;
this.personal.pauserothealth_finished = this.pauserothealth_finished;
this.ammo_fuel = this.personal.ammo_fuel;
this.health = this.personal.health;
this.armorvalue = this.personal.armorvalue;
- this.weapons = this.personal.weapons;
+ STAT(WEAPONS, this) = this.personal.weapons;
this.items = this.personal.items;
this.pauserotarmor_finished = time + this.personal.pauserotarmor_finished - this.personal.teleport_time;
this.pauserothealth_finished = time + this.personal.pauserothealth_finished - this.personal.teleport_time;
this.revival_time = 0;
this.items = 0;
- this.weapons = '0 0 0';
+ STAT(WEAPONS, this) = '0 0 0';
this.drawonlytoclient = this;
this.viewloc = NULL;
this.ammo_fuel = warmup_start_ammo_fuel;
this.health = warmup_start_health;
this.armorvalue = warmup_start_armorvalue;
- this.weapons = WARMUP_START_WEAPONS;
+ STAT(WEAPONS, this) = WARMUP_START_WEAPONS;
} else {
this.ammo_shells = start_ammo_shells;
this.ammo_nails = start_ammo_nails;
this.ammo_fuel = start_ammo_fuel;
this.health = start_health;
this.armorvalue = start_armorvalue;
- this.weapons = start_weapons;
+ STAT(WEAPONS, this) = start_weapons;
if (MUTATOR_CALLHOOK(ForbidRandomStartWeapons, this) == false)
{
GiveRandomWeapons(this, random_start_weapons_count,
PS(this).dual_weapons = '0 0 0';
- this.superweapons_finished = (this.weapons & WEPSET_SUPERWEAPONS) ? time + autocvar_g_balance_superweapons_time : 0;
+ this.superweapons_finished = (STAT(WEAPONS, this) & WEPSET_SUPERWEAPONS) ? time + autocvar_g_balance_superweapons_time : 0;
this.items = start_items;
}
if (this.items & IT_SUPERWEAPON)
{
- if (!(this.weapons & WEPSET_SUPERWEAPONS))
+ if (!(STAT(WEAPONS, this) & WEPSET_SUPERWEAPONS))
{
this.superweapons_finished = 0;
this.items = this.items - (this.items & IT_SUPERWEAPON);
if (time > this.superweapons_finished)
{
this.items = this.items - (this.items & IT_SUPERWEAPON);
- this.weapons &= ~WEPSET_SUPERWEAPONS;
+ STAT(WEAPONS, this) &= ~WEPSET_SUPERWEAPONS;
//Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_SUPERWEAPON_BROKEN, this.netname);
Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_BROKEN);
}
}
}
- else if(this.weapons & WEPSET_SUPERWEAPONS)
+ else if(STAT(WEAPONS, this) & WEPSET_SUPERWEAPONS)
{
if (time < this.superweapons_finished || (this.items & IT_UNLIMITED_SUPERWEAPONS))
{
else
{
this.superweapons_finished = 0;
- this.weapons &= ~WEPSET_SUPERWEAPONS;
+ STAT(WEAPONS, this) &= ~WEPSET_SUPERWEAPONS;
}
}
else
this.invincible_finished = spectatee.invincible_finished;
this.superweapons_finished = spectatee.superweapons_finished;
STAT(PRESSED_KEYS, this) = STAT(PRESSED_KEYS, spectatee);
- this.weapons = spectatee.weapons;
+ STAT(WEAPONS, this) = STAT(WEAPONS, spectatee);
this.punchangle = spectatee.punchangle;
this.view_ofs = spectatee.view_ofs;
this.velocity = spectatee.velocity;
SetResourceAmount(actor, RESOURCE_PLASMA, start_ammo_plasma);
SetResourceAmount(actor, RESOURCE_FUEL, start_ammo_fuel);
- actor.weapons = start_weapons;
+ STAT(WEAPONS, actor) = start_weapons;
if (this.spawnflags & 32)
{
// TODO
// WEAPONTODO: remove this
//WepSet weaponsInMap;
-#define weapons _STAT(WEAPONS)
+//#define weapons _STAT(WEAPONS)
+.WepSet weapons; // WEAPONTODO: remove this too, items can safely use the stat, weapon code shouldn't need it!
.float respawn_countdown; // next number to count
// after a frag, exchange the current weapon (or the culprit, if detectable) by a new random weapon
Weapon culprit = DEATH_WEAPONOF(deathtype);
if(!culprit) culprit = attacker.(weaponentity).m_weapon;
- else if(!(attacker.weapons & (culprit.m_wepset))) culprit = attacker.(weaponentity).m_weapon;
+ else if(!(STAT(WEAPONS, attacker) & (culprit.m_wepset))) culprit = attacker.(weaponentity).m_weapon;
if(g_weaponarena_random_with_blaster && culprit == WEP_BLASTER) // WEAPONTODO: Shouldn't this be in a mutator?
{
GiveFrags_randomweapons.weapons = start_weapons;
// all others (including the culprit): remove
- GiveFrags_randomweapons.weapons &= ~attacker.weapons;
+ GiveFrags_randomweapons.weapons &= ~STAT(WEAPONS, attacker);
GiveFrags_randomweapons.weapons &= ~(culprit.m_wepset);
// among the remaining ones, choose one by random
if(GiveFrags_randomweapons.weapons)
{
- attacker.weapons |= GiveFrags_randomweapons.weapons;
- attacker.weapons &= ~(culprit.m_wepset);
+ STAT(WEAPONS, attacker) |= GiveFrags_randomweapons.weapons;
+ STAT(WEAPONS, attacker) &= ~(culprit.m_wepset);
}
}
// after a frag, choose another random weapon set
- if (!(attacker.weapons & WepSet_FromWeapon(attacker.(weaponentity).m_weapon)))
+ if (!(STAT(WEAPONS, attacker) & WepSet_FromWeapon(attacker.(weaponentity).m_weapon)))
W_SwitchWeapon_Force(attacker, w_getbestweapon(attacker, weaponentity), weaponentity);
}
{
if (!wep) return;
- e.weapons |= WepSet_FromWeapon(Weapons_from(wep));
+ STAT(WEAPONS, e) |= WepSet_FromWeapon(Weapons_from(wep));
if (IS_PLAYER(e)) {
Send_Notification(NOTIF_ONE, e, MSG_MULTI, ITEM_WEAPON_GOT, wep);
// ignore hook button when using other offhand equipment
if (this.offhand != OFFHAND_HOOK)
- if (wpn == WEP_HOOK && !((this.weapons | weaponsInMap) & WepSet_FromWeapon(wpn)))
+ if (wpn == WEP_HOOK && !((STAT(WEAPONS, this) | weaponsInMap) & WepSet_FromWeapon(wpn)))
complain = 0;
if (complain)
}
if (autocvar_g_weaponswitch_debug == 2 && weaponslot(weaponentity) > 0 && !(wpn.spawnflags & WEP_FLAG_DUALWIELD) && !(PS(this).dual_weapons & wpn.m_wepset))
return false; // no complaints needed
- if (this.weapons & WepSet_FromWeapon(wpn))
+ if (STAT(WEAPONS, this) & WepSet_FromWeapon(wpn))
{
if (andammo)
{
FOREACH(Weapons, it != WEP_Null, {
if(i != weaponwant)
if(it.impulse == imp || imp < 0)
- if((this.weapons & (it.m_wepset)) || (weaponsInMap & (it.m_wepset)))
+ if((STAT(WEAPONS, this) & (it.m_wepset)) || (weaponsInMap & (it.m_wepset)))
have_other = true;
});
// skip weapons we don't own that aren't normal and aren't in the map
- if(!(this.weapons & wepset))
+ if(!(STAT(WEAPONS, this) & wepset))
if(!(weaponsInMap & wepset))
if((wep.spawnflags & WEP_FLAG_MUTATORBLOCKED) || have_other)
continue;
FOREACH(Weapons, it != WEP_Null, {
if(i != weaponwant)
if(it.impulse == imp || imp < 0)
- if((this.weapons & (it.m_wepset)) || (weaponsInMap & (it.m_wepset)))
+ if((STAT(WEAPONS, this) & (it.m_wepset)) || (weaponsInMap & (it.m_wepset)))
have_other = true;
});
// skip weapons we don't own that aren't normal and aren't in the map
- if(!(this.weapons & wepset))
+ if(!(STAT(WEAPONS, this) & wepset))
if(!(weaponsInMap & wepset))
if((wep.spawnflags & WEP_FLAG_MUTATORBLOCKED) || have_other)
continue;
// hack to ensure it switches to an OTHER weapon (in case the other fire mode still has ammo, we want that anyway)
Weapon ww;
WepSet set = WepSet_FromWeapon(this.(weaponentity).m_weapon);
- if (this.weapons & set)
+ if (STAT(WEAPONS, this) & set)
{
- this.weapons &= ~set;
+ STAT(WEAPONS, this) &= ~set;
ww = w_getbestweapon(this, weaponentity);
- this.weapons |= set;
+ STAT(WEAPONS, this) |= set;
}
else
{
int superweapons = 1;
FOREACH(Weapons, it != WEP_Null, {
WepSet set = it.m_wepset;
- if((set & WEPSET_SUPERWEAPONS) && (own.weapons & set)) ++superweapons;
+ if((set & WEPSET_SUPERWEAPONS) && (STAT(WEAPONS, own) & set)) ++superweapons;
});
if(superweapons <= 1)
{
return;
WepSet set = WepSet_FromWeapon(w);
- if(!(this.weapons & set)) return;
- this.weapons &= ~set;
+ if(!(STAT(WEAPONS, this) & set)) return;
+ STAT(WEAPONS, this) &= ~set;
W_SwitchWeapon_Force(this, w_getbestweapon(this, weaponentity), weaponentity);
string a = W_ThrowNewWeapon(this, w.m_id, doreduce, this.origin + delta, velo, weaponentity);
{
//entity wep = this.(weaponentity).m_weapon;
- if(this.weapons & WepSet_FromWeapon(wep))
+ if(STAT(WEAPONS, this) & WepSet_FromWeapon(wep))
if(W_IsWeaponThrowable(this, wep.m_id))
W_ThrowNewWeapon(this, wep.m_id, false, org, randomvec() * 125 + '0 0 200', weaponentity);
}
// server framerate is very low and the weapon fire rate very high
for (int c = 0; c < W_TICSPERFRAME; ++c)
{
- if (w != WEP_Null && !(actor.weapons & WepSet_FromWeapon(w)))
+ if (w != WEP_Null && !(STAT(WEAPONS, actor) & WepSet_FromWeapon(w)))
{
if (this.m_weapon == this.m_switchweapon) W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
w = WEP_Null;
key_pressed = false;
Weapon off = actor.offhand;
- if (off && (!(actor.weapons & WEPSET(HOOK)) || off != OFFHAND_HOOK))
+ if (off && (!(STAT(WEAPONS, actor) & WEPSET(HOOK)) || off != OFFHAND_HOOK))
{
if (off.offhand_think) off.offhand_think(off, actor, key_pressed);
}