]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/throwing.qc
Merge branch 'master' into TimePath/debug_draw
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / throwing.qc
index 4c6b99a5013358fe2bd0a65960aa44e007604754..d36e2dd4697fc3f97ab9c94f8621926be52de8c9 100644 (file)
@@ -1,7 +1,7 @@
 #include "throwing.qh"
 
 #include "weaponsystem.qh"
-#include "../mutators/mutators_include.qh"
+#include "../mutators/all.qh"
 #include "../t_items.qh"
 #include "../g_damage.qh"
 #include "../../common/items/item.qh"
@@ -34,12 +34,12 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
 {SELFPARAM();
        float thisammo, i;
        string s;
-       var .int ammotype = (get_weaponinfo(wpn)).ammo_field;
+       Weapon info = get_weaponinfo(wpn);
+       var .int ammotype = info.ammo_field;
 
-       entity wep = spawn();
+       entity wep = new(droppedweapon);
 
        setorigin(wep, org);
-       wep.classname = "droppedweapon";
        wep.velocity = velo;
        wep.owner = wep.enemy = own;
        wep.flags |= FL_TOSSED;
@@ -75,7 +75,7 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                }
        }
 
-       WITH(entity, self, wep, weapon_defaultspawnfunc(wpn));
+       weapon_defaultspawnfunc(wep, info);
        if(startitem_failed)
                return string_null;
        wep.glowmod = own.weaponentity_glowmod;
@@ -171,7 +171,8 @@ void W_ThrowWeapon(vector velo, vector delta, float doreduce)
                return;
        if(!autocvar_g_weapon_throwable)
                return;
-       if(self.weaponentity.state != WS_READY)
+       int slot = 0; // TODO: unhardcode
+       if(self.weaponentity[slot].state != WS_READY)
                return;
        if(!W_IsWeaponThrowable(w))
                return;