]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add machinegun support to target_give
authorbones_was_here <bones_was_here@yahoo.com.au>
Sun, 9 Aug 2020 08:03:09 +0000 (18:03 +1000)
committerbones_was_here <bones_was_here@yahoo.com.au>
Sun, 9 Aug 2020 08:03:09 +0000 (18:03 +1000)
qcsrc/server/compat/quake3.qc

index bc3000a03b9472f20ecd06c346181e9496f716eb..b1db26e822f08ea860b067c8471a090012f94d1d 100644 (file)
@@ -194,7 +194,7 @@ spawnfunc(target_init)
        InitializeEntity(this, target_init_verify, INITPRIO_FINDTARGET);
 }
 
-// weapon give ent from defrag
+// weapon give ent from Q3
 void target_give_init(entity this)
 {
        IL_EACH(g_items, it.targetname == this.target,
@@ -227,6 +227,10 @@ void target_give_init(entity this)
                        SetResourceExplicit(this, RES_SHELLS, GetResource(this, RES_SHELLS) + it.count * WEP_CVAR_PRI(shotgun, ammo)); // WEAPONTODO
                        this.netname = cons(this.netname, "shotgun");
                }
+               else if (it.classname == "weapon_machinegun") {
+                       SetResourceExplicit(this, RES_BULLETS, GetResource(this, RES_BULLETS) + it.count * WEP_CVAR(machinegun, burst_ammo)); // WEAPONTODO
+                       this.netname = cons(this.netname, "machinegun");
+               }
                else if (it.classname == "item_armor_mega")
                        SetResourceExplicit(this, RES_ARMOR, 100);
                else if (it.classname == "item_health_mega")