fix craft all for 1 piece missing

This commit is contained in:
shoopea 2020-02-10 18:22:34 +08:00
parent 812bf50e14
commit 2abb957a55

8
job.go
View File

@ -2094,13 +2094,7 @@ func jobCraftAll(j Job) {
for k, i := range ratioItems { for k, i := range ratioItems {
recipes, _ := totalRecipes[k] recipes, _ := totalRecipes[k]
parts, _ := totalParts[k] parts, _ := totalParts[k]
if k == "a83" || k == "a84" { if (recipes > 0 && parts >= (i-1)) || (parts >= i) {
log.Printf("jobCraftAll[%s] DEBUG > ratio : %d | parts : %d | recipes : %d\n", k, i, parts, recipes)
}
if (recipes > 0 && parts > (i-1)) || (parts >= i) {
if k == "a83" || k == "a84" {
log.Printf("jobCraftAll[%s] STORE > ratio : %d | parts : %d | recipes : %d\n", k, i, parts, recipes)
}
completeItems[k] = float64(MinInt64(recipes*i, parts) / i) completeItems[k] = float64(MinInt64(recipes*i, parts) / i)
maxItems = MaxInt64(maxItems, int64(completeItems[k])) maxItems = MaxInt64(maxItems, int64(completeItems[k]))
} }