ATTRIB(WeaponPickup, m_sound, Sound, SND_WEAPONPICKUP)
#endif
#ifdef SVQC
+ ATTRIB(WeaponPickup, m_itemflags, int, FL_WEAPON)
float weapon_pickupevalfunc(entity player, entity item);
ATTRIB(WeaponPickup, m_pickupevalfunc, float(entity player, entity item), weapon_pickupevalfunc)
#endif
e.spawnshieldtime = 1;
e.ItemStatus &= ~ITS_AVAILABLE;
}
- else if(e.itemdef.instanceOfWeaponPickup && !(e.flags & FL_NO_WEAPON_STAY) && g_weapon_stay)
+ else {
+ entity def = e.itemdef;
+ bool nostay = def.instanceOfWeaponPickup ? !!(def.m_weapon.weapons & WEPSET_SUPERWEAPONS) : false // no weapon-stay on superweapons
+ || e.team // weapon stay isn't supported for teamed weapons
+ ;
+ if(def.instanceOfWeaponPickup && !nostay && g_weapon_stay)
{
// make the item translucent and not touchable
e.model = e.mdl;
e.glowmod = e.colormod;
e.spawnshieldtime = 1;
e.ItemStatus &= ~ITS_AVAILABLE;
- }
+ }}
if (e.items & ITEM_Strength.m_itemid || e.items & ITEM_Shield.m_itemid)
e.ItemStatus |= ITS_POWERUP;
RemoveItem();
}
-void _StartItem(entity this, entity def, float defaultrespawntime, float defaultrespawntimejitter, float itemflags)
+void _StartItem(entity this, entity def, float defaultrespawntime, float defaultrespawntimejitter)
{
string itemname = def.m_name;
Model itemmodel = def.m_model;
Sound pickupsound = def.m_sound;
float(entity player, entity item) pickupevalfunc = def.m_pickupevalfunc;
float pickupbasevalue = def.m_botvalue;
+ int itemflags = def.m_itemflags;
startitem_failed = false;
this,
this.itemdef = def,
def.m_respawntime(), // defaultrespawntime
- def.m_respawntimejitter(), // defaultrespawntimejitter
- def.m_itemflags // itemflags
+ def.m_respawntimejitter() // defaultrespawntimejitter
);
}
.float is_item;
.entity itemdef;
-void _StartItem(entity this, entity def, float defaultrespawntime, float defaultrespawntimejitter, float itemflags);
+void _StartItem(entity this, entity def, float defaultrespawntime, float defaultrespawntimejitter);
void target_items_use (void);
if (g_pickup_weapons_anyway)
this.pickup_anyway = true;
- int f = FL_WEAPON;
-
- // no weapon-stay on superweapons
- if (e.weapons & WEPSET_SUPERWEAPONS)
- f |= FL_NO_WEAPON_STAY;
-
- // weapon stay isn't supported for teamed weapons
- if (this.team)
- f |= FL_NO_WEAPON_STAY;
-
GameItem def = e.m_pickup;
_StartItem(
this,
this.itemdef = def,
this.respawntime, // defaultrespawntime
- this.respawntimejitter, // defaultrespawntimejitter
- f // itemflags
+ this.respawntimejitter // defaultrespawntimejitter
);
#if 0 // WEAPONTODO
if (this.modelindex) { // don't precache if this was removed