Quantcast

Call EnableDisablePOIIntegration() and ReloadWaypoints after PLAYER_LOGIN.

Ludovicus [10-18-20 - 22:38]
Call EnableDisablePOIIntegration() and ReloadWaypoints after PLAYER_LOGIN.
Filename
TomTom.lua
diff --git a/TomTom.lua b/TomTom.lua
index 4be40cc..45f6b26 100755
--- a/TomTom.lua
+++ b/TomTom.lua
@@ -166,7 +166,6 @@ function TomTom:Initialize(event, addon)
 	end

     self:ReloadOptions()
-    self:ReloadWaypoints()

     if self.db.profile.feeds.coords then
         -- Create a data feed for coordinates
@@ -199,6 +198,13 @@ function TomTom:Initialize(event, addon)
     end
 end

+function TomTom:Enable(addon)
+    if not TomTom.CLASSIC then
+        self:EnableDisablePOIIntegration()
+    end
+    self:ReloadWaypoints()
+end
+
 -- Some utility functions that can pack/unpack data from a waypoint

 -- Returns a hashable 'key' for a given waypoint consisting of the
@@ -241,9 +247,6 @@ function TomTom:ReloadOptions()
     self:ShowHideWorldCoords()
     self:ShowHideCoordBlock()
     self:ShowHideCrazyArrow()
-    if not TomTom.CLASSIC then
-        self:EnableDisablePOIIntegration()
-    end
 end

 function TomTom:ClearAllWaypoints()