From bca3ee9294fa2a1bdce02447e2bc4d3427a52836 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sun, 9 Aug 2020 18:03:09 +1000 Subject: [PATCH] Add machinegun support to target_give --- qcsrc/server/compat/quake3.qc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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") -- 2.39.2