]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Removed references to droppedweapon.
authorLyberta <lyberta@lyberta.net>
Mon, 16 Oct 2017 05:20:14 +0000 (08:20 +0300)
committerLyberta <lyberta@lyberta.net>
Mon, 16 Oct 2017 05:20:14 +0000 (08:20 +0300)
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/mutators/mutator/instagib/sv_instagib.qc
qcsrc/common/t_items.qc
qcsrc/server/bot/default/havocbot/roles.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/mutator/gamemode_cts.qc
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/spawning.qc
qcsrc/server/weapons/throwing.qc

index 5a0ff2a2c22ade90150d22cad3fbcfdb8be07f3b..7eb8ecb4b0bd62a30004870d7c4a869ec87b85da 100644 (file)
@@ -909,7 +909,7 @@ MUTATOR_HOOKFUNCTION(nb, FilterItem)
 {
        entity item = M_ARGV(0, entity);
 
-       if(item.classname == "droppedweapon")
+       if(Item_IsLoot(item))
        if(item.weapon == WEP_NEXBALL.m_id)
                return true;
 
index 8716264f4719739330feed37b14bf694f9e79235..a81b4e7951a5a90a17a570bccdee0182e77440e8 100644 (file)
@@ -427,7 +427,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, FilterItem)
                return true;
        }
 
-       if(item.weapon == WEP_VAPORIZER.m_id && item.classname == "droppedweapon")
+       if(item.weapon == WEP_VAPORIZER.m_id && Item_IsLoot(item))
        {
                SetResourceAmount(item, RESOURCE_CELLS, autocvar_g_instagib_ammo_drop);
                return false;
index da491b71871eb86ead9b45a522938d93191461fe..81568e86a21ce1bbcc6de27620aabd8d039ee59f 100644 (file)
@@ -1343,7 +1343,7 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default
 
        if(def.instanceOfWeaponPickup)
        {
-               if (this.classname != "droppedweapon") // if dropped, colormap is already set up nicely
+               if (!Item_IsLoot(this)) // if dropped, colormap is already set up nicely
                        this.colormap = 1024; // color shirt=0 pants=0 grey
                else
                        this.gravity = 1;
@@ -1444,7 +1444,7 @@ void setItemGroupCount()
 
 void target_items_use(entity this, entity actor, entity trigger)
 {
-       if(actor.classname == "droppedweapon")
+       if(Item_IsLoot(actor))
        {
                EXACTTRIGGER_TOUCH(this, trigger);
                delete(actor);
@@ -1459,7 +1459,7 @@ void target_items_use(entity this, entity actor, entity trigger)
                EXACTTRIGGER_TOUCH(this, trigger);
        }
 
-       IL_EACH(g_items, it.enemy == actor && it.classname == "droppedweapon",
+       IL_EACH(g_items, it.enemy == actor && Item_IsLoot(it),
        {
                delete(it);
        });
index 94aed9c96e1219333a5c792572b7a33e74a9a0cd..aa1884a33592e4634954165bb2cd2d53f81ea666 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <server/defs.qh>
 #include <server/miscfunctions.qh>
+#include <server/items.qh>
 #include "havocbot.qh"
 
 #include "../cvars.qh"
@@ -81,7 +82,7 @@ void havocbot_goalrating_items(entity this, float ratingscale, vector org, float
                        continue;
 
                // Check if the item can be picked up safely
-               if(it.classname == "droppedweapon")
+               if(Item_IsLoot(it))
                {
                        if(!IS_ONGROUND(it))
                                continue;
index e3c6797f367dbfe81aadd43915a56670fb1e0f67..ef69905bdcfbdcbc561ad7e782acb06923b2574e 100644 (file)
@@ -8,6 +8,7 @@
 #include "mutators/_mod.qh"
 #include "../common/t_items.qh"
 #include "resources.qh"
+#include "items.qh"
 #include "weapons/accuracy.qh"
 #include "weapons/csqcprojectile.qh"
 #include "weapons/selection.qh"
@@ -1437,10 +1438,13 @@ bool isPushable(entity e)
                return false;
        if(e.iscreature)
                return true;
+       if (Item_IsLoot(e))
+       {
+               return true;
+       }
        switch(e.classname)
        {
                case "body":
-               case "droppedweapon":
                        return true;
                case "bullet": // antilagged bullets can't hit this either
                        return false;
index 20f4b383d11296c1c2265dd5e65e9550762ea954..ca892c52ff538c59f2205bf25d1090ed48ddf1bc 100644 (file)
@@ -1,7 +1,7 @@
 #include "gamemode_cts.qh"
-#include <server/race.qh>
 
 #include <server/race.qh>
+#include <server/items.qh>
 
 float autocvar_g_cts_finish_kill_delay;
 bool autocvar_g_cts_selfdamage;
@@ -314,8 +314,10 @@ MUTATOR_HOOKFUNCTION(cts, FilterItem)
 {
        entity item = M_ARGV(0, entity);
 
-       if(item.classname == "droppedweapon")
+       if (Item_IsLoot(item))
+       {
                return true;
+       }
 }
 
 MUTATOR_HOOKFUNCTION(cts, Damage_Calculate)
index 776d8d8d0f43800999a3b10829cb3c9c20cc2d93..693d5a240456323adab1c259b51dfb2551275386 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "weaponsystem.qh"
 #include <common/t_items.qh>
+#include <server/items.qh>
 #include <common/constants.qh>
 #include <common/net_linked.qh>
 #include <common/util.qh>
@@ -25,8 +26,10 @@ void Weapon_whereis(Weapon this, entity cl)
        if (!autocvar_g_showweaponspawns) return;
        IL_EACH(g_items, it.weapon == this.m_id && (!it.team || (it.ItemStatus & ITS_AVAILABLE)),
        {
-               if (it.classname == "droppedweapon" && autocvar_g_showweaponspawns < 2)
+               if (Item_IsLoot(it) && (autocvar_g_showweaponspawns < 2))
+               {
                        continue;
+               }
                entity wp = WaypointSprite_Spawn(
                        WP_Weapon,
                        -2, 0,
index 244c1c62371b41edcdc45a376d3845f550e9ded3..c1ff4e0217615a74a706a9153418c15310efbe69 100644 (file)
@@ -4,6 +4,7 @@
 #include "../resources.qh"
 #include "../mutators/_mod.qh"
 #include <common/t_items.qh>
+#include <server/items.qh>
 #include <common/weapons/_all.qh>
 
 string W_Apply_Weaponreplace(string in)
@@ -28,7 +29,7 @@ void weapon_defaultspawnfunc(entity this, Weapon e)
        Weapon wpn = e;
        e = wpn = wpn.m_spawnfunc_hookreplace(wpn, this);
        this.classname = wpn.m_canonical_spawnfunc;
-       if (this.classname != "droppedweapon" && this.classname != "replacedweapon")
+       if (!Item_IsLoot(this) && this.classname != "replacedweapon")
        {
                if (e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
                {
index 91602e750ad08c0e19b9b18995185fd115f8cc7f..ae745efd6fdaa90f6ed39b9d8b59e4736a3c26fa 100644 (file)
@@ -41,7 +41,7 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
        Weapon info = Weapons_from(wpn);
        int ammotype = info.ammo_type;
 
-       entity wep = new(droppedweapon);
+       entity wep = spawn();
        Item_SetLoot(wep, true);
        setorigin(wep, org);
        wep.velocity = velo;