mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 22:16:03 +01:00
Fix Old QBinv and new/old Psinv stashes being wiped
This appeared to only happen with `jim-mechanic` repair from stash, due to the stashitem's table not being sent to the function Making it save an empty table to the database But this was possible in other places too I've added fallbacks for if it didn't receive a table, grab a fresh one from cache/database
This commit is contained in:
@@ -402,6 +402,9 @@ function stashRemoveItem(stashItems, stashName, items)
|
||||
debugPrint("^6Bridge^7: ^2Removing item from ^3Stash^2 with ^7"..QBInv, k, v)
|
||||
end
|
||||
else
|
||||
if not stashItems or not next(stashItems) then
|
||||
stashItems = getStash(stashName[1])
|
||||
end
|
||||
for k, v in pairs(items) do
|
||||
for l in pairs(stashItems) do
|
||||
if stashItems[l].name == k then
|
||||
@@ -423,6 +426,9 @@ function stashRemoveItem(stashItems, stashName, items)
|
||||
end
|
||||
|
||||
elseif isStarted(PSInv) then
|
||||
if not stashItems or not next(stashItems) then
|
||||
stashItems = getStash(stashName[1])
|
||||
end
|
||||
for k, v in pairs(items) do
|
||||
for l in pairs(stashItems) do
|
||||
if stashItems[l].name == k then
|
||||
|
||||
Reference in New Issue
Block a user