# HG changeset patch # User James D. Callahan III # Date 1348168464 18000 # Node ID e0550c57972d61132f5439e5c0b87873337a7594 # Parent b06147ded0bc9a0d991a09999135176d883faf98 Listen for ZONE_CHANGED_NEW_AREA and ZONE_CHANGED_INDOORS for location updates. diff -r b06147ded0bc -r e0550c57972d Main.lua --- a/Main.lua Wed Sep 19 09:29:56 2012 -0500 +++ b/Main.lua Thu Sep 20 14:14:24 2012 -0500 @@ -31,7 +31,7 @@ ----------------------------------------------------------------------- -- Local constants. ----------------------------------------------------------------------- -local DB_VERSION = 6 +local DB_VERSION = 7 local DATABASE_DEFAULTS = { @@ -85,7 +85,9 @@ UNIT_SPELLCAST_SENT = true, UNIT_SPELLCAST_SUCCEEDED = true, VOID_STORAGE_OPEN = true, - ZONE_CHANGED = true, + ZONE_CHANGED = "SetCurrentAreaID", + ZONE_CHANGED_INDOORS = "SetCurrentAreaID", + ZONE_CHANGED_NEW_AREA = "SetCurrentAreaID", } @@ -534,7 +536,7 @@ end -- do-block -local function SetCurrentAreaID() +function WDP:SetCurrentAreaID(event_name) local map_area_id = _G.GetCurrentMapAreaID() _G.SetMapToCurrentZone() @@ -591,7 +593,7 @@ local _, item_link = _G.GetItemInfo(identifier) HandleItemUse(item_link) end) - SetCurrentAreaID() + self:SetCurrentAreaID("OnEnable") _G.hooksecurefunc("SetBlacklistMap", UpdateBlacklistMaps) _G.hooksecurefunc("ClearBlacklistMap", UpdateBlacklistMaps) @@ -1728,11 +1730,6 @@ end -function WDP:ZONE_CHANGED(event_name) - SetCurrentAreaID() -end - - do local function SetUnitField(field, required_type) local unit_type, unit_idnum = ParseGUID(_G.UnitGUID("npc"))