Fixed crafting item removing bug & stuff

master
AlmTech Software 5 years ago
parent 80e79ebf2c
commit 7ef46dcc14
  1. 10
      gamemode/engine/lib/server/sv_crafting.lua

@ -57,10 +57,16 @@ function Quantum.Server.Crafting.MakeItem( pl, itemid )
-- get items -- get items
local slots = Quantum.Server.Inventory.FindItemSlots( pl, reqItem.item, inv ) local slots = Quantum.Server.Inventory.FindItemSlots( pl, reqItem.item, inv )
local itemCount = 0
-- loop through all slots and remove them -- loop through all slots and remove them
for i, slot in pairs( slots ) do for i, slot in pairs( slots ) do
Quantum.Server.Inventory.RemoveSlotItem( pl, char, slot, reqItem.amount ) if( itemCount < reqItem.amount ) then
itemCount = itemCount + inv[slot][2]
print( inv[slot][2] )
Quantum.Server.Inventory.RemoveSlotItem( pl, char, slot, inv[slot][2] )
end
if( i >= #slots ) then local itemCount = 0 end
end end
end end

Loading…
Cancel
Save