diff Main.lua @ 522:39c3576943ba

Added a debug message for Ephemeral Crystals and switched to the localized reference for 'type'.
author MMOSimca <mmosimca@gmail.com>
date Wed, 16 Nov 2016 04:00:23 -0500
parents 3fee2a08fdaa
children 4d8f02877b4f
line wrap: on
line diff
--- a/Main.lua	Tue Nov 08 19:50:04 2016 -0500
+++ b/Main.lua	Wed Nov 16 04:00:23 2016 -0500
@@ -957,9 +957,9 @@
     end
     local func = EVENT_MAPPING[event_name]
 
-    if _G.type(func) == "boolean" then
+    if type(func) == "boolean" then
         self[event_name](self, ...)
-    elseif _G.type(func) == "function" then
+    elseif type(func) == "function" then
         self[func](self, ...)
     end
 end
@@ -972,7 +972,7 @@
         if EVENT_DEBUG then
             self:RegisterEvent(event_name, "EventDispatcher")
         else
-            self:RegisterEvent(event_name, (_G.type(mapping) ~= "boolean") and mapping or nil)
+            self:RegisterEvent(event_name, (type(mapping) ~= "boolean") and mapping or nil)
         end
     end
 
@@ -2162,7 +2162,7 @@
             local location_token = ("%d:%d:%d"):format(current_loot.map_level, current_loot.x, current_loot.y)
 
             -- This will start life as a boolean true.
-            if _G.type(current_loot.zone_data[location_token]) ~= "table" then
+            if type(current_loot.zone_data[location_token]) ~= "table" then
                 current_loot.zone_data[location_token] = {
                     drops = {}
                 }
@@ -2342,7 +2342,7 @@
             return
         end
 
-        if _G.type(verify_func) == "function" and not verify_func() then
+        if type(verify_func) == "function" and not verify_func() then
             Debug("%s: The current action type, %s, is supported but has failed loot verification.", event_name, private.ACTION_TYPE_NAMES[current_action.target_type])
             return
         end
@@ -3015,6 +3015,7 @@
     -- For Ephemeral Crystals (uses a combination of mouseover text and a 'Update Interactions' spell cast to detect the object - this is incredibly hacky but there is no alternative)
     local text = _G["GameTooltipTextLeft1"] and _G["GameTooltipTextLeft1"]:GetText() or nil
     if spell_id == SPELL_ID_UPDATE_INTERACTIONS and text and text == "Ephemeral Crystal" then
+        Debug("%s: Detected location for an Ephemeral Crystal.", event_name)
         for index = 1, #private.EPHEMERAL_CRYSTAL_OBJECT_IDS do
             UpdateDBEntryLocation("objects", private.EPHEMERAL_CRYSTAL_OBJECT_IDS[index])
         end