Skip to content

Commit

Permalink
Update TFTB.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Gogo1951 authored Nov 16, 2024
1 parent 140a45b commit 67717e1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions TFTB.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ local function clearExpiredCooldowns(now)
end
end

-- Check if a player is in your party or raid
local function isInPartyOrRaid(sourceGUID)
for i = 1, GetNumGroupMembers() do
local unitID = IsInRaid() and "raid" .. i or "party" .. i
if UnitGUID(unitID) == sourceGUID then
return true
end
end
return false
end

function BuffCheerAddon:shouldProcessEvent()
return not self.state.hasLoggedIn and not self.state.inCombat
end
Expand All @@ -49,6 +60,11 @@ function BuffCheerAddon:OnCombatEvent(...)
clearExpiredCooldowns(now)

if destGUID == UnitGUID("player") and sourceGUID ~= UnitGUID("player") then
-- Check if the source is in the same party or raid
if isInPartyOrRaid(sourceGUID) then
return -- Skip thanking party/raid members
end

if not self.thankCooldown[sourceGUID] then
self.thankCooldown[sourceGUID] = now + self.config.cooldownDuration
local emote = self.config.randomEmotes[math.random(1, #self.config.randomEmotes)]
Expand Down

0 comments on commit 67717e1

Please sign in to comment.