# HG changeset patch # User James D. Callahan III # Date 1349193513 18000 # Node ID 15ff29752523b4e88ce56d02fe9e345eed210226 # Parent dc02d8eb919dfa7b874cb8a08782a386026d3e2a Workaround for strange WoW client handling of Micro Dungeons. diff -r dc02d8eb919d -r 15ff29752523 Main.lua --- a/Main.lua Thu Sep 27 08:33:48 2012 -0500 +++ b/Main.lua Tue Oct 02 10:58:33 2012 -0500 @@ -312,6 +312,7 @@ if map_id < 0 then empty_count = empty_count + 1 + empty_count = empty_count + 1 end end @@ -575,13 +576,42 @@ end -- do-block -function WDP:SetCurrentAreaID(event_name) - local map_area_id = _G.GetCurrentMapAreaID() - _G.SetMapToCurrentZone() +do + -- MapFileName = MapAreaID + local MICRO_DUNGEON_IDS = { + ShrineofTwoMoons = 903, + ShrineofSevenStars = 905, + } - current_area_id = _G.GetCurrentMapAreaID() - _G.SetMapByID(map_area_id) -end + -- Contains a dirty hack due to Blizzard's strange handling of Micro Dungeons; GetMapInfo() will not return correct information + -- unless the WorldMapFrame is shown. + function WDP:SetCurrentAreaID(event_name) + local world_map = _G.WorldMapFrame + local map_visible = world_map:IsVisible() + local sfx_value = _G.tonumber(_G.GetCVar("Sound_EnableSFX")) + + if not map_visible then + _G.SetCVar("Sound_EnableSFX", 0) + world_map:Show() + end + local micro_dungeon_id = MICRO_DUNGEON_IDS[select(5, _G.GetMapInfo())] + + if micro_dungeon_id then + current_area_id = micro_dungeon_id + else + local map_area_id = _G.GetCurrentMapAreaID() + _G.SetMapToCurrentZone() + + current_area_id = _G.GetCurrentMapAreaID() + _G.SetMapByID(map_area_id) + end + + if not map_visible then + world_map:Hide() + _G.SetCVar("Sound_EnableSFX", sfx_value) + end + end +end -- do-block -----------------------------------------------------------------------