Skip to content

Commit

Permalink
Ignore friendly totems
Browse files Browse the repository at this point in the history
  • Loading branch information
d87 committed Mar 1, 2021
1 parent e2c8fb4 commit a35c5c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,5 @@ globals = {
"CreateTexturePool",
"C_NamePlate",
"GetSpellTexture",
"UnitReaction",
}
7 changes: 7 additions & 0 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ end)

local showDuration = true
local showCooldownCount = false
local showFriendlyTotems = false

local activeTotems = {}
local totemStartTimes = setmetatable({ __mode = "V" }, {})
Expand Down Expand Up @@ -83,6 +84,12 @@ function f.NAME_PLATE_UNIT_ADDED(self, event, unit)
local npcID = GetNPCIDByGUID(guid)

if npcID and totemNpcIDs[npcID] then
if not showFriendlyTotems then
-- local isAttackable = UnitCanAttack("player", unit)
local isFriendly = UnitReaction(unit, "player") >= 4
if isFriendly then return end
end

if not np.NugTotemIcon then
np.NugTotemIcon = CreateIcon(np)
end
Expand Down

0 comments on commit a35c5c4

Please sign in to comment.