fix: mailbox error

This commit is contained in:
Vati
2026-04-06 19:01:48 +04:00
parent 4b67cb2fbe
commit 7eaedbf115
7 changed files with 31 additions and 3315 deletions
+6 -1
View File
@@ -14,15 +14,20 @@ addon.Modules.SharedData = SharedData
function SharedData:Initialize()
-- Clean up any leaked shared characters from the old approach
if Guda_DB and Guda_DB.characters then
-- Collect keys to remove first (can't modify table during pairs iteration)
local toRemove = {}
for fullName, data in pairs(Guda_DB.characters) do
if data.isShared then
Guda_DB.characters[fullName] = nil
table.insert(toRemove, fullName)
else
-- Strip leaked fields from own characters
data.isShared = nil
data.account = nil
end
end
for _, fullName in ipairs(toRemove) do
Guda_DB.characters[fullName] = nil
end
end
-- Initialize in-memory shared characters table