// switch between weapons
-void Send_WeaponComplain(entity e, float wpn, string wpnname, float type)
+void Send_WeaponComplain(entity e, float wpn, float type)
{
msg_entity = e;
WriteByte(MSG_ONE, SVC_TEMPENTITY);
WriteByte(MSG_ONE, TE_CSQC_WEAPONCOMPLAIN);
WriteByte(MSG_ONE, wpn);
- WriteString(MSG_ONE, wpnname);
WriteByte(MSG_ONE, type);
}
if(time < self.hasweapon_complain_spam)
complain = 0;
+
+ if(wpn == WEP_HOOK && !g_grappling_hook && autocvar_g_nades && !((cl.weapons | weaponsInMap) & WepSet_FromWeapon(wpn)))
+ complain = 0;
+
if(complain)
self.hasweapon_complain_spam = time + 0.2;
sprint(self, "Invalid weapon\n");
return FALSE;
}
- if (WEPSET_CONTAINS_EW(cl, wpn))
+ if (cl.weapons & WepSet_FromWeapon(wpn))
{
if (andammo)
{
if(IS_REAL_CLIENT(cl))
{
play2(cl, "weapons/unavailable.wav");
- Send_WeaponComplain (cl, wpn, W_Name(wpn), 0);
+ Send_WeaponComplain (cl, wpn, 0);
}
return FALSE;
}
{
// DRESK - 3/16/07
// Report Proper Weapon Status / Modified Weapon Ownership Message
- if (WEPSET_CONTAINS_AW(weaponsInMap, wpn))
+ if (weaponsInMap & WepSet_FromWeapon(wpn))
{
- Send_WeaponComplain(cl, wpn, W_Name(wpn), 1);
+ Send_WeaponComplain(cl, wpn, 1);
if(autocvar_g_showweaponspawns)
{
entity e;
- string s;
-
- e = get_weaponinfo(wpn);
- s = e.model2;
for(e = world; (e = findfloat(e, weapon, wpn)); )
{
if(e.classname == "droppedweapon")
continue;
- if not(e.flags & FL_ITEM)
+ if(!(e.flags & FL_ITEM))
continue;
WaypointSprite_Spawn(
- s,
+ (get_weaponinfo(wpn)).wpmodel,
1, 0,
world, e.origin,
self, 0,
}
else
{
- Send_WeaponComplain (cl, wpn, W_Name(wpn), 2);
+ Send_WeaponComplain (cl, wpn, 2);
}
play2(cl, "weapons/unavailable.wav");
switchtonext = switchtolast = 0;
first_valid = prev_valid = 0;
float weaponcur;
+ entity wep;
if(skipmissing || pl.selectweapon == 0)
weaponcur = pl.switchweapon;
while(rest != "")
{
weaponwant = stof(car(rest)); rest = cdr(rest);
+ wep = get_weaponinfo(weaponwant);
if(imp >= 0)
- if((get_weaponinfo(weaponwant)).impulse != imp)
+ if(wep.impulse != imp)
continue;
+ // skip weapons we don't own that aren't normal and aren't in the map
+ if(!(pl.weapons & WepSet_FromWeapon(weaponwant)))
+ if(!((get_weaponinfo(weaponwant)).spawnflags & WEP_FLAG_NORMAL))
+ if(!(weaponsInMap & WepSet_FromWeapon(weaponwant)))
+ continue;
+
++c;
if(!skipmissing || client_hasweapon(pl, weaponwant, TRUE, FALSE))
while(rest != "")
{
weaponwant = stof(car(rest)); rest = cdr(rest);
+ wep = get_weaponinfo(weaponwant);
if(imp >= 0)
- if((get_weaponinfo(weaponwant)).impulse != imp)
+ if(wep.impulse != imp)
continue;
+ // skip weapons we don't own that aren't normal and aren't in the map
+ if(!(pl.weapons & WepSet_FromWeapon(weaponwant)))
+ if(!((get_weaponinfo(weaponwant)).spawnflags & WEP_FLAG_NORMAL))
+ if(!(weaponsInMap & WepSet_FromWeapon(weaponwant)))
+ continue;
+
--c;
if(c == 0)
{
// hack to ensure it switches to an OTHER weapon (in case the other fire mode still has ammo, we want that anyway)
float w, ww;
w = pl.weapon;
- if(WEPSET_CONTAINS_EW(pl, w))
+ if(pl.weapons & WepSet_FromWeapon(w))
{
- WEPSET_ANDNOT_EW(pl, w);
+ pl.weapons &= ~WepSet_FromWeapon(w);
ww = w_getbestweapon(pl);
- WEPSET_OR_EW(pl, w);
+ pl.weapons |= WepSet_FromWeapon(w);
}
else
ww = w_getbestweapon(pl);