Skip to content

Commit

Permalink
Update Better Crafting plugin (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
wowm0d committed May 5, 2020
1 parent 17ccd93 commit 8686c1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ixcraft/meta/sh_recipe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ if (SERVER) then
if (self.requirements) then
local removedItems = {}

for id, itemTable in pairs(inventory:GetItems()) do
for _, itemTable in pairs(inventory:GetItems()) do
local uniqueID = itemTable.uniqueID

if (self.requirements[uniqueID]) then
local amountRemoved = removedItems[uniqueID] or 0
local amount = self.requirements[uniqueID]

if (amountRemoved < amount) then
inventory:Remove(id)
itemTable:Remove()

removedItems[uniqueID] = amountRemoved + 1
end
Expand Down

0 comments on commit 8686c1e

Please sign in to comment.