ingredient max count fix

This commit is contained in:
kepler155c
2018-03-06 18:09:03 -05:00
parent b2ba4b272d
commit f08794079e
2 changed files with 2 additions and 5 deletions

View File

@@ -156,11 +156,7 @@ end
function itemDB:getMaxCount(item)
local detail = self:get(item)
if detail then
return detail.maxCount
end
return 64
return detail and detail.maxCount or 64
end
function itemDB:load()

View File

@@ -126,6 +126,7 @@ function Craft.craftRecipe(recipe, count, inventoryAdapter)
if recipe.craftingTools and recipe.craftingTools[key] then
need = 1
end
maxCount = math.min(maxCount, itemDB:getMaxCount(key))
if itemCount < need then
local irecipe = Craft.findRecipe(key)
if irecipe then