Skip to content

Commit d3e0d6c

Browse files
committed
Resync inventory after exact item errors
1 parent bd79fab commit d3e0d6c

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

UI/MultiBotInventoryItem.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ MultiBot.OnBridgeInventoryItemDestroyResult = function(botName, _, reason)
646646

647647
requestInventoryRefresh(0.15, botName)
648648
end
649-
MultiBot.OnBridgeInventoryItemTradeResult = function(_, status, reason)
649+
MultiBot.OnBridgeInventoryItemTradeResult = function(botName, status, reason)
650650
if reason == "DISCONNECTED" then
651651
return
652652
end
@@ -656,6 +656,10 @@ MultiBot.OnBridgeInventoryItemTradeResult = function(_, status, reason)
656656
inventoryItemL("inventory.item_trade.failed", "The item could not be added to the trade.")
657657
.. " [" .. tostring(reason or "FAILED") .. "]"
658658
)
659+
660+
if reason == "SOURCE_STALE" or reason == "BAD_RESPONSE" or reason == "RESPONSE_MISMATCH" or reason == "TIMEOUT" then
661+
requestInventoryRefresh(0.15, botName)
662+
end
659663
end
660664
end
661665

@@ -1067,6 +1071,11 @@ function MultiBot.OnBridgeInventoryItemActionResult(botName, action, itemId, res
10671071
actionLabel
10681072
))
10691073
end
1074+
1075+
if (action == "BANK_DEPOSIT" or action == "GBANK_DEPOSIT")
1076+
and (reason == "SOURCE_STALE" or reason == "BAD_RESPONSE" or reason == "RESPONSE_MISMATCH" or reason == "TIMEOUT") then
1077+
requestInventoryRefresh(0.15, botName)
1078+
end
10701079
end
10711080

10721081
local function cloneInventoryExactItem(sourceItem, location)

0 commit comments

Comments
 (0)