Right, of course, UnitIsPLayer expects a UNIT how silly of me.....

I hate the wow api
This commit is contained in:
2025-01-12 23:25:31 +01:00
parent ca333a93e3
commit 18fd4bb9d2
4 changed files with 21 additions and 19 deletions

View File

@@ -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)

Binary file not shown.

View File

@@ -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

View File

@@ -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