This commit is contained in:
shoopea 2020-08-08 12:41:42 +02:00
parent a12e7be611
commit ec489436e9

6
job.go
View File

@ -2754,17 +2754,21 @@ func jobVaultValOth(j Job) {
for _, v := range p2.Vault { for _, v := range p2.Vault {
price, volume := getObjItemValDet(v.ItemID64, v.Quality, 90) price, volume := getObjItemValDet(v.ItemID64, v.Quality, 90)
if volume > 0 { if volume > 0 {
item, _ := getObjItem(v.ItemID64)
t := JobPayloadVaultValTab{ t := JobPayloadVaultValTab{
ItemID64: v.ItemID64, ItemID64: v.ItemID64,
Quality: v.Quality, Quality: v.Quality,
Quantity: v.Quantity, Quantity: v.Quantity,
Volume: volume, Volume: volume,
Price: price, Price: price,
Weight: item.Weight,
} }
p.Val = append(p.Val, t) p.Val = append(p.Val, t)
} }
} }
sort.Slice(p.Val, func(i, j int) bool { return p.Val[i].Volume < p.Val[j].Volume }) sort.Slice(p.Val, func(i, j int) bool {
return p.Val[i].Price/float64(p.Val[i].Weight) < p.Val[j].Price/float64(p.Val[j].Weight)
})
out := fmt.Sprintf("Value (other) :\n") out := fmt.Sprintf("Value (other) :\n")
total := float64(0) total := float64(0)