changeset 155:0c4a6ea88403

Before setting current_area_id, check to see if the area ID the map is set to matches current_area_id to avoid opening/closing the WorldMapFrame unnecessarily.
author James D. Callahan III <jcallahan@curse.com>
date Fri, 05 Oct 2012 14:15:53 -0500
parents 6c16692eebb0
children 749fdb864fdf
files Main.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Main.lua	Thu Oct 04 14:10:39 2012 -0500
+++ b/Main.lua	Fri Oct 05 14:15:53 2012 -0500
@@ -609,9 +609,13 @@
     }
 
     function WDP:SetCurrentAreaID(event_name)
+        local map_area_id = _G.GetCurrentMapAreaID()
+
+        if map_area_id == current_area_id then
+            return
+        end
         local world_map = _G.WorldMapFrame
         local map_visible = world_map:IsVisible()
-        local map_area_id = _G.GetCurrentMapAreaID()
         local sfx_value = _G.tonumber(_G.GetCVar("Sound_EnableSFX"))
 
         if not map_visible then