From 622e0172286fa044f3aed76677db6b6d26112ef7 Mon Sep 17 00:00:00 2001 From: shagu Date: Tue, 19 Dec 2023 13:26:36 +0100 Subject: [PATCH] mapreveal: keep all revealed zones by the gameclient Only extend with missing unrevealed zones instead of overwriting the entire map reveal logic of the game. This is required to not break custom servers/clients that are shipping their own zones. --- modules/mapreveal.lua | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/mapreveal.lua b/modules/mapreveal.lua index c218efce..3825bc3b 100644 --- a/modules/mapreveal.lua +++ b/modules/mapreveal.lua @@ -215,10 +215,20 @@ pfUI:RegisterModule("mapreveal", "vanilla:tbc", function () end end end - for i = textureCount + 1, NUM_WORLDMAP_OVERLAYS do - _G[string.format("%s%s","WorldMapOverlay",i)]:Hide() - end end - hooksecurefunc("WorldMapFrame_Update", pfWorldMapFrame_Update, true) + -- hook map reveal functions before and after the actual call + local pfHookWorldMapFrame_Update = _G.WorldMapFrame_Update + _G.WorldMapFrame_Update = function(self) + -- hide all previously set textures + for i = 1, NUM_WORLDMAP_OVERLAYS do + _G[string.format("%s%s","WorldMapOverlay",i)]:Hide() + end + + -- let the game put its explored tiles on the map + pfHookWorldMapFrame_Update(self) + + -- let the addon extend it with its own data + pfWorldMapFrame_Update() + end end)