update post check

This commit is contained in:
shoopea 2020-05-31 18:03:51 +02:00
parent 210b60fe68
commit 0aa7b91f3c

6
job.go
View File

@ -2478,7 +2478,7 @@ func jobCheckVaultLimit(j Job) {
empty = true
out = fmt.Sprintf("%sWar summary :\n", out)
for _, iPre := range pPre.Vault {
for _, iPre := range pPre.Vault { // compare pre with post (pre is only resources
var itemEmpty bool = true
for _, iPost := range pPost.Vault {
if iPre.ItemID64 == iPost.ItemID64 {
@ -2500,7 +2500,7 @@ func jobCheckVaultLimit(j Job) {
out = fmt.Sprintf("%s- [%s] lost %d\n", out, obj.Names[0], iPre.Quantity)
}
}
for _, iPost := range pPost.Vault {
for _, iPost := range pPost.Vault { // compare post with pre, filter to only check resources
var itemEmpty bool = true
for _, iPre := range pPre.Vault {
if iPre.ItemID64 == iPost.ItemID64 {
@ -2510,9 +2510,11 @@ func jobCheckVaultLimit(j Job) {
if itemEmpty {
empty = false
obj, _ := getObjItem(iPost.ItemID64)
if obj.ItemTypeID == cacheObjSubType[`item_res`] {
out = fmt.Sprintf("%s- [%s] won %d\n", out, obj.Names[0], iPost.Quantity)
}
}
}
c := TGCommand{
Type: commandSendMsg,