Right, of course, UnitIsPLayer expects a UNIT how silly of me.....
I hate the wow api
This commit is contained in:
@@ -12,12 +12,20 @@ function shared.BonkDetector.Init()
|
||||
local frame = CreateFrame("Frame")
|
||||
frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
|
||||
frame:SetScript("OnEvent", function(self, event, ...)
|
||||
if Heimdall_Data.config.bonkDetector.debug then
|
||||
print(string.format("[%s] Combat log event received", ModuleName))
|
||||
end
|
||||
if not Heimdall_Data.config.bonkDetector.enabled then
|
||||
-- if Heimdall_Data.config.bonkDetector.debug then
|
||||
-- print(string.format("[%s] Combat log event received", ModuleName))
|
||||
-- end
|
||||
-- if not Heimdall_Data.config.bonkDetector.enabled then
|
||||
-- if Heimdall_Data.config.bonkDetector.debug then
|
||||
-- print(string.format("[%s] Module disabled, ignoring combat event", ModuleName))
|
||||
-- end
|
||||
-- return
|
||||
-- end
|
||||
|
||||
local subevent = select(2, ...)
|
||||
if not subevent:find("_DAMAGE") then
|
||||
if Heimdall_Data.config.bonkDetector.debug then
|
||||
print(string.format("[%s] Module disabled, ignoring combat event", ModuleName))
|
||||
print(string.format("[%s] Not a damage event, ignoring: %s", ModuleName, subevent))
|
||||
end
|
||||
return
|
||||
end
|
||||
@@ -29,7 +37,8 @@ function shared.BonkDetector.Init()
|
||||
end
|
||||
return
|
||||
end
|
||||
if not UnitIsPlayer(source) then
|
||||
local sourceGUID = CLEUParser.GetSourceGUID(...)
|
||||
if not string.find(sourceGUID, "Player") then
|
||||
if Heimdall_Data.config.bonkDetector.debug then
|
||||
print(string.format("[%s] Source %s is not a player, nothing to do", ModuleName, source))
|
||||
end
|
||||
@@ -43,21 +52,14 @@ function shared.BonkDetector.Init()
|
||||
end
|
||||
return
|
||||
end
|
||||
if not UnitIsPlayer(destination) then
|
||||
local destinationGUID = CLEUParser.GetDestGUID(...)
|
||||
if not string.find(destinationGUID, "Player") then
|
||||
if Heimdall_Data.config.bonkDetector.debug then
|
||||
print(string.format("[%s] Destination %s is not a player, nothing to do", ModuleName, destination))
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local subevent = select(2, ...)
|
||||
if not subevent:find("_DAMAGE") then
|
||||
if Heimdall_Data.config.bonkDetector.debug then
|
||||
print(string.format("[%s] Not a damage event, ignoring: %s", ModuleName, subevent))
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local currentTime = GetTime()
|
||||
local throttle = Heimdall_Data.config.bonkDetector.throttle
|
||||
|
||||
|
||||
Reference in New Issue
Block a user