]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Completely removed droppedweapon.
authorLyberta <lyberta@lyberta.net>
Mon, 16 Oct 2017 08:07:23 +0000 (11:07 +0300)
committerLyberta <lyberta@lyberta.net>
Mon, 16 Oct 2017 08:07:23 +0000 (11:07 +0300)
qcsrc/common/items/item/ammo.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/server/items.qc

index 38a0a022a92b818defcd6a67456826de4703f82c..3a13a1f81855c51c2eaeea4bea5adda6e10c07b3 100644 (file)
@@ -4,7 +4,7 @@
 
 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;
        }
@@ -13,7 +13,7 @@ METHOD(Bullets, m_spawnfunc_hookreplace, GameItem(Bullets this, entity e))
 
 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;
        }
index 80cd21b481b41474dcf860d2d42178c95428f228..e6eb9b03defa392e3d5fb87b03118b4eb0e76d0b 100644 (file)
@@ -35,7 +35,8 @@ void monster_dropitem(entity this, entity attacker)
                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;
@@ -48,8 +49,6 @@ void monster_dropitem(entity this, entity attacker)
                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;
index 100a11a0cd2ee8683275dce84f6555c853e1fff1..80567c2955383932015ee9bb60eb6c5efac9738f 100644 (file)
@@ -4,8 +4,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;
        }
index b52a5a21ba9bb6a0b889e00d791d0c77693b02db..990bc29ee3d0da5c55087578aad7a0160e18b604 100644 (file)
@@ -6,8 +6,7 @@ REGISTER_NET_TEMP(TE_CSQC_SHOCKWAVEPARTICLE)
 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;
        }
index 8161e10c1e657fa30d950b72d5cb52a9c829bffb..1265f71c5e6cdb5cbf04a35037792828fdc31c9d 100644 (file)
@@ -75,7 +75,7 @@ bool Item_InitializeLoot(entity item, string class_name, vector position,
 
 bool Item_IsLoot(entity item)
 {
-       return item.m_isloot || (item.classname == "droppedweapon");
+       return item.m_isloot;
 }
 
 void Item_SetLoot(entity item, bool loot)