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
|
## Interface: 70300
|
||||||
## Title: Heimdall
|
## Title: Heimdall
|
||||||
## Version: 3.3.0
|
## Version: 3.3.1
|
||||||
## Notes: Watches over areas and alerts when hostiles spotted
|
## Notes: Watches over areas and alerts when hostiles spotted
|
||||||
## Author: Cyka
|
## Author: Cyka
|
||||||
## SavedVariables: Heimdall_Data
|
## 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")
|
local frame = CreateFrame("Frame")
|
||||||
frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
|
frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
|
||||||
frame:SetScript("OnEvent", function(self, event, ...)
|
frame:SetScript("OnEvent", function(self, event, ...)
|
||||||
if Heimdall_Data.config.bonkDetector.debug then
|
-- if Heimdall_Data.config.bonkDetector.debug then
|
||||||
print(string.format("[%s] Combat log event received", ModuleName))
|
-- print(string.format("[%s] Combat log event received", ModuleName))
|
||||||
end
|
-- end
|
||||||
if not Heimdall_Data.config.bonkDetector.enabled then
|
-- 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
|
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
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -29,7 +37,8 @@ function shared.BonkDetector.Init()
|
|||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not UnitIsPlayer(source) then
|
local sourceGUID = CLEUParser.GetSourceGUID(...)
|
||||||
|
if not string.find(sourceGUID, "Player") then
|
||||||
if Heimdall_Data.config.bonkDetector.debug then
|
if Heimdall_Data.config.bonkDetector.debug then
|
||||||
print(string.format("[%s] Source %s is not a player, nothing to do", ModuleName, source))
|
print(string.format("[%s] Source %s is not a player, nothing to do", ModuleName, source))
|
||||||
end
|
end
|
||||||
@@ -43,21 +52,14 @@ function shared.BonkDetector.Init()
|
|||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not UnitIsPlayer(destination) then
|
local destinationGUID = CLEUParser.GetDestGUID(...)
|
||||||
|
if not string.find(destinationGUID, "Player") then
|
||||||
if Heimdall_Data.config.bonkDetector.debug then
|
if Heimdall_Data.config.bonkDetector.debug then
|
||||||
print(string.format("[%s] Destination %s is not a player, nothing to do", ModuleName, destination))
|
print(string.format("[%s] Destination %s is not a player, nothing to do", ModuleName, destination))
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
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 currentTime = GetTime()
|
||||||
local throttle = Heimdall_Data.config.bonkDetector.throttle
|
local throttle = Heimdall_Data.config.bonkDetector.throttle
|
||||||
|
|
||||||
|
@@ -212,6 +212,7 @@ function shared.StinkyTracker.Init()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local name = UnitName(unit)
|
||||||
if not UnitIsPlayer(unit) then
|
if not UnitIsPlayer(unit) then
|
||||||
if Heimdall_Data.config.stinkyTracker.debug then
|
if Heimdall_Data.config.stinkyTracker.debug then
|
||||||
print(string.format("[%s] Target %s is not a player, nothing to do", ModuleName, name))
|
print(string.format("[%s] Target %s is not a player, nothing to do", ModuleName, name))
|
||||||
@@ -219,7 +220,6 @@ function shared.StinkyTracker.Init()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local name = UnitName(unit)
|
|
||||||
local enemy = UnitCanAttack("player", unit)
|
local enemy = UnitCanAttack("player", unit)
|
||||||
if enemy then
|
if enemy then
|
||||||
if Heimdall_Data.config.stinkyTracker.debug then
|
if Heimdall_Data.config.stinkyTracker.debug then
|
||||||
|
Reference in New Issue
Block a user