ingredient max count fix
This commit is contained in:
@@ -156,11 +156,7 @@ end
|
|||||||
|
|
||||||
function itemDB:getMaxCount(item)
|
function itemDB:getMaxCount(item)
|
||||||
local detail = self:get(item)
|
local detail = self:get(item)
|
||||||
if detail then
|
return detail and detail.maxCount or 64
|
||||||
return detail.maxCount
|
|
||||||
end
|
|
||||||
|
|
||||||
return 64
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function itemDB:load()
|
function itemDB:load()
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ function Craft.craftRecipe(recipe, count, inventoryAdapter)
|
|||||||
if recipe.craftingTools and recipe.craftingTools[key] then
|
if recipe.craftingTools and recipe.craftingTools[key] then
|
||||||
need = 1
|
need = 1
|
||||||
end
|
end
|
||||||
|
maxCount = math.min(maxCount, itemDB:getMaxCount(key))
|
||||||
if itemCount < need then
|
if itemCount < need then
|
||||||
local irecipe = Craft.findRecipe(key)
|
local irecipe = Craft.findRecipe(key)
|
||||||
if irecipe then
|
if irecipe then
|
||||||
|
|||||||
Reference in New Issue
Block a user