From: bones_was_here Date: Sun, 9 Aug 2020 08:03:09 +0000 (+1000) Subject: Add machinegun support to target_give X-Git-Tag: xonotic-v0.8.5~352^2~54 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bca3ee9294fa2a1bdce02447e2bc4d3427a52836;p=xonotic%2Fxonotic-data.pk3dir.git Add machinegun support to target_give --- diff --git a/qcsrc/server/compat/quake3.qc b/qcsrc/server/compat/quake3.qc index bc3000a03..b1db26e82 100644 --- a/qcsrc/server/compat/quake3.qc +++ b/qcsrc/server/compat/quake3.qc @@ -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")