METHOD(Bullets, m_spawnfunc_hookreplace, GameItem(Bullets this, entity e))
{
- if (autocvar_sv_q3acompat_machineshotgunswap && e.classname != "droppedweapon")
+ if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
{
return ITEM_Shells;
}
METHOD(Shells, m_spawnfunc_hookreplace, GameItem(Shells this, entity e))
{
- if (autocvar_sv_q3acompat_machineshotgunswap && e.classname != "droppedweapon")
+ if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
{
return ITEM_Bullets;
}
return;
vector org = CENTER_OR_VIEWOFS(this);
- entity e = new(droppedweapon); // use weapon handling to remove it on touch
+ entity e = spawn();
+ Item_SetLoot(e, true);
e.spawnfunc_checked = true;
e.monster_loot = this.monster_loot;
e.noalign = true;
StartItem(e, e.monster_loot);
e.gravity = 1;
- set_movetype(e, MOVETYPE_TOSS);
- e.reset = SUB_Remove;
setorigin(e, org);
e.velocity = randomvec() * 175 + '0 0 325';
e.item_spawnshieldtime = time + 0.7;
METHOD(MachineGun, m_spawnfunc_hookreplace, Weapon(MachineGun this, entity e))
{
- if(autocvar_sv_q3acompat_machineshotgunswap)
- if(e.classname != "droppedweapon")
+ if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
{
return WEP_SHOCKWAVE;
}
METHOD(Shockwave, m_spawnfunc_hookreplace, Weapon(Shockwave this, entity e))
{
//if(autocvar_sv_q3acompat_machineshockwaveswap) // WEAPONTODO
- if(autocvar_sv_q3acompat_machineshotgunswap)
- if(e.classname != "droppedweapon")
+ if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
{
return WEP_MACHINEGUN;
}
bool Item_IsLoot(entity item)
{
- return item.m_isloot || (item.classname == "droppedweapon");
+ return item.m_isloot;
}
void Item_SetLoot(entity item, bool loot)