From a5b4d21f55d12429cf0b4d95bc33d9dede13347c Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Tue, 1 Sep 2026 14:26:52 +0200 Subject: [PATCH] Normalize existing shared player cache --- libs/libunitscan.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libs/libunitscan.lua b/libs/libunitscan.lua index 8e013a0..2ae5446 100644 --- a/libs/libunitscan.lua +++ b/libs/libunitscan.lua @@ -89,6 +89,13 @@ local function NormalizePlayerData(data) end end +local function NormalizePlayerTable(playerdb) + if type(playerdb) ~= "table" then return end + for _, data in pairs(playerdb) do + NormalizePlayerData(data) + end +end + local function MergePlayerTable(target, source) if type(source) ~= "table" or source == target then return end @@ -207,6 +214,10 @@ local function MigrateLegacyPlayerCaches(playerdb, realmdb, realm) realmdb.players_cleanup = time() end + -- Also clean presentation fields left by earlier revisions of this test + -- branch that already wrote directly into ShaguTweaks_player_cache. + NormalizePlayerTable(playerdb) + cacheMigrationDone = true end