diff --git a/job.go b/job.go index e2208df..7e9b0fe 100644 --- a/job.go +++ b/job.go @@ -2007,9 +2007,9 @@ func jobCraftAll(j Job) { muxObjItem.RUnlock() for _, i := range p2.Vault { - if item, ok := itemsParts[i.ItemID64]; ok { + if item, ok := itemParts[i.ItemID64]; ok { totalParts[item] = i.Quantity - } else if item, ok := itemsRecipes[i.ItemID64]; ok { + } else if item, ok := itemRecipes[i.ItemID64]; ok { totalRecipes[item] = i.Quantity } } @@ -2018,7 +2018,7 @@ func jobCraftAll(j Job) { recipes, _ := totalRecipes[k] parts, _ := totalParts[k] if (recipes > 0 && parts > (i-1)) || (parts >= i) { - completeItems[k] = MinInt64(recipes*i, parts) / i + completeItems[k] = float64(MinInt64(recipes*i, parts) / i) maxItems = MaxInt64(maxItems, int64(completeItems[k])) } } diff --git a/utils.go b/utils.go index ee78588..5602325 100644 --- a/utils.go +++ b/utils.go @@ -30,7 +30,7 @@ func MinInt64(a int64, b int64) int64 { } } -func MaxInt(a int64, b int64) int64 { +func MaxInt64(a int64, b int64) int64 { if a > b { return a } else {