help with weightless item in g_stock
This commit is contained in:
parent
67ab18d177
commit
e917e6e47e
10
job.go
10
job.go
@ -803,6 +803,7 @@ func jobGStock(j Job) {
|
|||||||
item, err := getObjItem(v.ItemID64)
|
item, err := getObjItem(v.ItemID64)
|
||||||
logOnError(err, "jobGStock : getObjItem")
|
logOnError(err, "jobGStock : getObjItem")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
if item.Weight != -1 {
|
||||||
totalSize += item.Weight * v.Quantity
|
totalSize += item.Weight * v.Quantity
|
||||||
switch item.ItemTypeID {
|
switch item.ItemTypeID {
|
||||||
case objSubTypeItemResource:
|
case objSubTypeItemResource:
|
||||||
@ -824,8 +825,17 @@ func jobGStock(j Job) {
|
|||||||
otherSize += item.Weight * v.Quantity
|
otherSize += item.Weight * v.Quantity
|
||||||
otherCount += v.Quantity
|
otherCount += v.Quantity
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
w := TGCommand{
|
||||||
|
Type: commandSendMsg,
|
||||||
|
Text: fmt.Sprintf("Unknown weight for item : %s - %s\n", item.Code, item.Name),
|
||||||
|
ToUserID64: cfg.Bot.Admin,
|
||||||
|
}
|
||||||
|
TGCmdQueue <- w
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
txt := fmt.Sprintf("Current stock [%d/38000] :\n - Resources : %d (%d)\n - Alchemist : %d (%d)\n - Misc stuff : %d (%d)\n - Recipes : %d (%d)\n - Parts : %d (%d)\n - Other : %d (%d)\n", totalSize, resSize, resCount, alchSize, alchCount, miscSize, miscCount, recSize, recCount, partSize, partCount, otherSize, otherCount)
|
txt := fmt.Sprintf("Current stock [%d/38000] :\n - Resources : %d (%d)\n - Alchemist : %d (%d)\n - Misc stuff : %d (%d)\n - Recipes : %d (%d)\n - Parts : %d (%d)\n - Other : %d (%d)\n", totalSize, resSize, resCount, alchSize, alchCount, miscSize, miscCount, recSize, recCount, partSize, partCount, otherSize, otherCount)
|
||||||
|
|
||||||
m := TGCommand{
|
m := TGCommand{
|
||||||
|
Loading…
Reference in New Issue
Block a user