From: Lyberta Date: Mon, 16 Oct 2017 08:07:23 +0000 (+0300) Subject: Completely removed droppedweapon. X-Git-Tag: xonotic-v0.8.5~2426^2~23 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=68ef91c5b481a6e227d6f0f5c83bf03ba831a35a;p=xonotic%2Fxonotic-data.pk3dir.git Completely removed droppedweapon. --- diff --git a/qcsrc/common/items/item/ammo.qc b/qcsrc/common/items/item/ammo.qc index 38a0a022a..3a13a1f81 100644 --- a/qcsrc/common/items/item/ammo.qc +++ b/qcsrc/common/items/item/ammo.qc @@ -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; } diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 80cd21b48..e6eb9b03d 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -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; diff --git a/qcsrc/common/weapons/weapon/machinegun.qc b/qcsrc/common/weapons/weapon/machinegun.qc index 100a11a0c..80567c295 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qc +++ b/qcsrc/common/weapons/weapon/machinegun.qc @@ -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; } diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index b52a5a21b..990bc29ee 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -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; } diff --git a/qcsrc/server/items.qc b/qcsrc/server/items.qc index 8161e10c1..1265f71c5 100644 --- a/qcsrc/server/items.qc +++ b/qcsrc/server/items.qc @@ -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)