From 16702212304f25b866cf61e6e7dc259b4e907c55 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Tue, 7 Jun 2022 19:45:13 +0700 Subject: [PATCH] Fix inventory command only using first list item --- sources/Commands/ACommandInventory.uc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/Commands/ACommandInventory.uc b/sources/Commands/ACommandInventory.uc index 81a81e3..f7bfbb8 100644 --- a/sources/Commands/ACommandInventory.uc +++ b/sources/Commands/ACommandInventory.uc @@ -130,7 +130,7 @@ protected function SubCommandAdd( DynamicArray itemsArray, DynamicArray specifiedLists) { - local int i, j; + local int i; local int itemsAmount; local array itemsFromLists; if (tool == none) { @@ -147,7 +147,7 @@ protected function SubCommandAdd( // Add items from specified lists itemsFromLists = LoadAllItemsLists(specifiedLists); for (i = 0; i < itemsFromLists.length; i += 1) { - tool.AddItem(itemsFromLists[j], flagForce, flagAmmo); + tool.AddItem(itemsFromLists[i], flagForce, flagAmmo); } _.memory.FreeMany(itemsFromLists); } @@ -157,7 +157,7 @@ protected function SubCommandRemove( DynamicArray itemsArray, DynamicArray specifiedLists) { - local int i, j; + local int i; local int itemsAmount; local array itemsFromLists; if (tool == none) { @@ -184,7 +184,7 @@ protected function SubCommandRemove( // Remove items from specified lists itemsFromLists = LoadAllItemsLists(specifiedLists); for (i = 0; i < itemsFromLists.length; i += 1) { - tool.RemoveItem(itemsFromLists[j], flagKeep, flagForce, flagAll); + tool.RemoveItem(itemsFromLists[i], flagKeep, flagForce, flagAll); } _.memory.FreeMany(itemsFromLists); }