]> 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 900b45018db2b5b45edc0334c1c145f0874f3908..d36e2dd4697fc3f97ab9c94f8621926be52de8c9 100644 (file)
@@ -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;