fix g_deposit_all

This commit is contained in:
shoopea 2019-08-23 18:46:51 +08:00
parent 8feff19999
commit e205399d63

40
job.go
View File

@ -716,25 +716,27 @@ func jobGDeposit(j Job) {
var res, misc, alch, craft, equip bool = false, false, false, false, false
log.Printf("jobGDeposit : Checking items (%d).\n", len(p.ResObjID64))
if len(p.ResObjID64) > 0 {
obj, err := getObjItem(p.ResObjID64[0])
logOnError(err, "jobGDeposit : getObjItem")
if err == nil {
switch obj.ItemTypeID {
case objSubTypeItemResource:
res = true
case objSubTypeItemAlch:
alch = true
case objSubTypeItemMisc:
misc = true
case objSubTypeItemRecipe:
craft = true
case objSubTypeItemPart:
craft = true
case objSubTypeItemOther:
equip = true
case objSubTypeItemUnique:
equip = true
default:
for i := range p.ResObjID64 {
obj, err := getObjItem(p.ResObjID64[i])
logOnError(err, "jobGDeposit : getObjItem")
if err == nil {
switch obj.ItemTypeID {
case objSubTypeItemResource:
res = true
case objSubTypeItemAlch:
alch = true
case objSubTypeItemMisc:
misc = true
case objSubTypeItemRecipe:
craft = true
case objSubTypeItemPart:
craft = true
case objSubTypeItemOther:
equip = true
case objSubTypeItemUnique:
equip = true
default:
}
}
}
}