wep.flags |= FL_TOSSED;
wep.colormap = own.colormap;
- if(WEPSET_CONTAINS_AW(WEPBIT_SUPERWEAPONS, wpn))
+ if(WepSet_FromWeapon(wpn) & WEPSET_SUPERWEAPONS)
{
if(own.items & IT_UNLIMITED_SUPERWEAPONS)
{
{
float superweapons = 1;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
- if(WEPSET_CONTAINS_AW(WEPBIT_SUPERWEAPONS, i))
- if(WEPSET_CONTAINS_EW(own, i))
+ if(WepSet_FromWeapon(i) & WEPSET_SUPERWEAPONS)
+ if(own.weapons & WepSet_FromWeapon(i))
++superweapons;
if(superweapons <= 1)
{
return 0;
if(w == 0)
return 0;
-
+
wa = W_AmmoItemCode(w);
- if(WEPSET_CONTAINS_AW(start_weapons, w))
+ if(start_weapons & WepSet_FromWeapon(w))
{
// start weapons that take no ammo can't be dropped (this prevents dropping the laser, as long as it continues to use no ammo)
if(start_items & IT_UNLIMITED_WEAPON_AMMO)
if(!W_IsWeaponThrowable(w))
return;
- if(!WEPSET_CONTAINS_EW(self, w))
+ if(!(self.weapons & WepSet_FromWeapon(w)))
return;
- WEPSET_ANDNOT_EW(self, w);
+ self.weapons &= ~WepSet_FromWeapon(w);
W_SwitchWeapon_Force(self, w_getbestweapon(self));
a = W_ThrowNewWeapon(self, w, doreduce, self.origin + delta, velo);
-
- if not(a) return;
+
+ if (!a) return;
Send_Notification(NOTIF_ONE, self, MSG_MULTI, ITEM_WEAPON_DROP, a, w);
}
self.switchingweapon = 0;
self.weaponentity.state = WS_CLEAR;
self.weaponname = "";
- self.items &~= IT_AMMO;
+ self.items &= ~IT_AMMO;
return;
}
// VorteX: add player model weapon select frame here
// setcustomframe(PlayerWeaponRaise);
weapon_thinkf(WFRAME_IDLE, cvar(sprintf("g_balance_%s_switchdelay_raise", newwep.netname)), w_ready);
+ //printf("W_WeaponFrame(): cvar: %s, value: %f\n", sprintf("g_balance_%s_switchdelay_raise", newwep.netname), cvar(sprintf("g_balance_%s_switchdelay_raise", newwep.netname)));
weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');
}
else if (self.weaponentity.state == WS_DROP)
self.switchingweapon = self.switchweapon;
entity oldwep = get_weaponinfo(self.weapon);
-
+
#ifndef INDEPENDENT_ATTACK_FINISHED
if(ATTACK_FINISHED(self) <= time + self.weapon_frametime * 0.5)
{
#endif
- sound (self, CH_WEAPON_SINGLE, "weapons/weapon_switch.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_SINGLE, "weapons/weapon_switch.wav", VOL_BASE, ATTEN_NORM);
self.weaponentity.state = WS_DROP;
// set up weapon switch think in the future, and start drop anim
weapon_thinkf(WFRAME_DONTCHANGE, cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname)), w_clear);
+ //printf("W_WeaponFrame(): cvar: %s, value: %f\n", sprintf("g_balance_%s_switchdelay_drop", oldwep.netname), cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname)));
weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);
#ifndef INDEPENDENT_ATTACK_FINISHED
}
while (c < W_TICSPERFRAME)
{
c = c + 1;
- if(w && !WEPSET_CONTAINS_EW(self, w))
+ if(w && !(self.weapons & WepSet_FromWeapon(w)))
{
if(self.weapon == self.switchweapon)
W_SwitchWeapon_Force(self, w_getbestweapon(self));