From f388480ef8b5f9648c6c7cddb45932b2a7d162d0 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Tue, 7 Jun 2022 18:58:48 +0700 Subject: [PATCH] Add missing lists to templates component --- .../Trading/KF1_TemplatesComponent.uc | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/sources/Gameplay/KF1Frontend/Trading/KF1_TemplatesComponent.uc b/sources/Gameplay/KF1Frontend/Trading/KF1_TemplatesComponent.uc index 0096b84..d9dea51 100644 --- a/sources/Gameplay/KF1Frontend/Trading/KF1_TemplatesComponent.uc +++ b/sources/Gameplay/KF1Frontend/Trading/KF1_TemplatesComponent.uc @@ -33,6 +33,7 @@ var private array berserkerWeaponsList; var private array firebugWeaponsList; var private array demolitionWeaponsList; var private array neutralWeaponsList; +var private array toolWeaponsList; protected function Finalizer() { @@ -45,6 +46,7 @@ protected function Finalizer() _.memory.FreeMany(firebugWeaponsList); _.memory.FreeMany(demolitionWeaponsList); _.memory.FreeMany(neutralWeaponsList); + _.memory.FreeMany(toolWeaponsList); _.memory.FreeMany(availableWeaponLists); if (allWeaponsList.length > 0) { allWeaponsList.length = 0; @@ -76,6 +78,9 @@ protected function Finalizer() if (availableWeaponLists.length > 0) { availableWeaponLists.length = 0; } + if (toolWeaponsList.length > 0) { + toolWeaponsList.length = 0; + } listsAreReady = false; } @@ -97,15 +102,19 @@ private function BuildKFWeaponLists() firebugWeaponsList = MakeWeaponList(kfLevelRules.fireItemForSale); demolitionWeaponsList = MakeWeaponList(kfLevelRules.demoItemForSale); neutralWeaponsList = MakeWeaponList(kfLevelRules.neutItemForSale); - availableWeaponLists[0] = _.text.FromString("all weapons"); - availableWeaponLists[1] = _.text.FromString("trading weapons"); - availableWeaponLists[2] = _.text.FromString("medic weapons"); - availableWeaponLists[3] = _.text.FromString("support weapons"); - availableWeaponLists[4] = _.text.FromString("sharpshooter weapons"); - availableWeaponLists[5] = _.text.FromString("commando weapons"); - availableWeaponLists[6] = _.text.FromString("firebug weapons"); - availableWeaponLists[7] = _.text.FromString("demolition weapons"); - availableWeaponLists[8] = _.text.FromString("neutral weapons"); + toolWeaponsList[0] = _.text.FromString("kfmod.syringe"); + toolWeaponsList[1] = _.text.FromString("kfmod.welder"); + availableWeaponLists[0] = _.text.FromString("all weapons"); + availableWeaponLists[1] = _.text.FromString("trading weapons"); + availableWeaponLists[2] = _.text.FromString("medic weapons"); + availableWeaponLists[3] = _.text.FromString("support weapons"); + availableWeaponLists[4] = _.text.FromString("sharpshooter weapons"); + availableWeaponLists[5] = _.text.FromString("commando weapons"); + availableWeaponLists[6] = _.text.FromString("firebug weapons"); + availableWeaponLists[7] = _.text.FromString("firebug weapons"); + availableWeaponLists[8] = _.text.FromString("demolition weapons"); + availableWeaponLists[9] = _.text.FromString("tools"); + availableWeaponLists[10] = _.text.FromString("neutral weapons"); listsAreReady = true; } @@ -157,6 +166,7 @@ public function bool ItemListExists(Text listName) if (listNameAsString == "berserker weapons") return true; if (listNameAsString == "firebug weapons") return true; if (listNameAsString == "demolition weapons") return true; + if (listNameAsString == "tools") return true; if (listNameAsString == "neutral weapons") return true; return false; @@ -198,6 +208,9 @@ public function array GetItemList(Text listName) if (listNameAsString == "demolition weapons") { return CopyList(demolitionWeaponsList); } + if (listNameAsString == "tools") { + return CopyList(toolWeaponsList); + } if (listNameAsString == "neutral weapons") { return CopyList(neutralWeaponsList); }