diff --git a/job.go b/job.go index cc593ee..2f98f0d 100644 --- a/job.go +++ b/job.go @@ -1908,25 +1908,20 @@ func jobGetVault(j Job) { p JobPayloadGetVault reqTab map[int64]int64 doneTab map[int64]int64 + items []string = {`item_res`, `item_alch`, `item_misc`, `item_recipe`, `item_part`, `item_other`} ) log.Printf("jobGetVault[%d] : Starting.\n", j.ID64) reqTab = make(map[int64]int64) - reqTab[cacheObjSubType[`item_res`]] = 1 << 0 - reqTab[cacheObjSubType[`item_alch`]] = 1 << 1 - reqTab[cacheObjSubType[`item_misc`]] = 1 << 2 - reqTab[cacheObjSubType[`item_recipe`]] = 1 << 3 - reqTab[cacheObjSubType[`item_part`]] = 1 << 4 - reqTab[cacheObjSubType[`item_other`]] = 1 << 5 + for k, v := range items { + reqTab[cacheObjSubType[v]] = 1 << k + } doneTab = make(map[int64]int64) - doneTab[cacheObjSubType[`item_res`]] = 1 << 10 - doneTab[cacheObjSubType[`item_alch`]] = 1 << 11 - doneTab[cacheObjSubType[`item_misc`]] = 1 << 12 - doneTab[cacheObjSubType[`item_recipe`]] = 1 << 13 - doneTab[cacheObjSubType[`item_part`]] = 1 << 14 - doneTab[cacheObjSubType[`item_other`]] = 1 << 15 + for k, v := range items { + doneTab[cacheObjSubType[v]] = 1 << (10 + k) + } err := setJobStart(j.ID64) logOnError(err, "jobGetVault : setJobStart") @@ -1938,7 +1933,7 @@ func jobGetVault(j Job) { for _, typeID64 := range p.ItemTypeList { p.Status = p.Status | reqTab[typeID64] } - for _, v := range {`item_res`, `item_alch`, `item_misc`, `item_recipe`, `item_part`, `item_other`} { + for _, v := range items { if (p.Status & reqTab[cacheObjSubType[v]]) == 0 { p.Status = p.Status | doneTab[cacheObjSubType[v]] }