This commit is contained in:
shoopea 2020-01-26 21:53:56 +08:00
parent 3f61af2ce9
commit 88a069af26

26
job.go
View File

@ -929,6 +929,8 @@ func jobGStock(j Job) {
jobID64, err := createJob(cacheObjSubType[`job_get_vault`], objJobPriority, j.UserID64, 0, time.Now().UTC(), b)
p.Status = 1
p.VaultJobID64 = jobID64
b, err = json.Marshal(p)
logOnError(err, "jobGStock : Marshal(p)")
@ -1933,28 +1935,14 @@ func jobGetVault(j Job) {
logOnError(err, "jobGetVault : Unmarshal payload")
if p.Status == 0 {
for k, typeID64 := range p.ItemTypeList {
for _, typeID64 := range p.ItemTypeList {
p.Status = p.Status | reqTab[typeID64]
}
if (p.Status & reqTab[cacheObjSubType[`item_res`]]) == 0 {
p.Status = p.Status | doneTab[cacheObjSubType[`item_res`]]
for _, v := range {`item_res`, `item_alch`, `item_misc`, `item_recipe`, `item_part`, `item_other`} {
if (p.Status & reqTab[cacheObjSubType[v]]) == 0 {
p.Status = p.Status | doneTab[cacheObjSubType[v]]
}
}
if (p.Status & reqTab[cacheObjSubType[`item_alch`]]) == 0 {
p.Status = p.Status | doneTab[cacheObjSubType[`item_alch`]]
}
if (p.Status & reqTab[cacheObjSubType[`item_misc`]]) == 0 {
p.Status = p.Status | doneTab[cacheObjSubType[`item_misc`]]
}
if (p.Status & reqTab[cacheObjSubType[`item_recipe`]]) == 0 {
p.Status = p.Status | doneTab[cacheObjSubType[`item_recipe`]]
}
if (p.Status & reqTab[cacheObjSubType[`item_part`]]) == 0 {
p.Status = p.Status | doneTab[cacheObjSubType[`item_part`]]
}
if (p.Status & reqTab[cacheObjSubType[`item_other`]]) == 0 {
p.Status = p.Status | doneTab[cacheObjSubType[`item_other`]]
}
}
if j.Trigger != 0 {