Quantcast

Add Classic detection and dont register PET_BATTLE_ events.

Ludovicus [06-19-19 - 22:32]
Add Classic detection and dont register PET_BATTLE_ events.
Filename
TomTom.lua
diff --git a/TomTom.lua b/TomTom.lua
index 6871fbb..c5d7bbe 100755
--- a/TomTom.lua
+++ b/TomTom.lua
@@ -13,6 +13,7 @@ local addonName, addon = ...
 local TomTom = addon

 addon.hbd = hbd
+addon.CLASSIC = math.floor(select(4, GetBuildInfo() ) / 100) == 113

 -- Local definitions
 local GetCurrentCursorPosition
@@ -151,8 +152,10 @@ function TomTom:Initialize(event, addon)
     C_ChatInfo.RegisterAddonMessagePrefix("TOMTOM4")

 	-- Watch for pet battle start/end so we can hide/show the arrow
-	self:RegisterEvent("PET_BATTLE_OPENING_START", "ShowHideCrazyArrow")
-	self:RegisterEvent("PET_BATTLE_CLOSE", "ShowHideCrazyArrow")
+	if not self.CLASSIC then
+	    self:RegisterEvent("PET_BATTLE_OPENING_START", "ShowHideCrazyArrow")
+	    self:RegisterEvent("PET_BATTLE_CLOSE", "ShowHideCrazyArrow")
+	end

     self:ReloadOptions()
     self:ReloadWaypoints()