Right, of course, UnitIsPLayer expects a UNIT how silly of me.....
I hate the wow api
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
## Interface: 70300
|
||||
## Title: Heimdall
|
||||
## Version: 3.3.0
|
||||
## Version: 3.3.1
|
||||
## Notes: Watches over areas and alerts when hostiles spotted
|
||||
## Author: Cyka
|
||||
## SavedVariables: Heimdall_Data
|
||||
|
BIN
Heimdall.zip
(Stored with Git LFS)
BIN
Heimdall.zip
(Stored with Git LFS)
Binary file not shown.
@@ -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
|
||||
|
||||
|
@@ -212,6 +212,7 @@ function shared.StinkyTracker.Init()
|
||||
return
|
||||
end
|
||||
|
||||
local name = UnitName(unit)
|
||||
if not UnitIsPlayer(unit) then
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
print(string.format("[%s] Target %s is not a player, nothing to do", ModuleName, name))
|
||||
@@ -219,7 +220,6 @@ function shared.StinkyTracker.Init()
|
||||
return
|
||||
end
|
||||
|
||||
local name = UnitName(unit)
|
||||
local enemy = UnitCanAttack("player", unit)
|
||||
if enemy then
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
|
Reference in New Issue
Block a user