Skip to content

Commit

Permalink
Disabled addon in 5-man parties
Browse files Browse the repository at this point in the history
  • Loading branch information
4bitfocus committed Dec 30, 2020
1 parent 3bf9812 commit d1ff561
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions LootRollLedger/LootRollLedger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -418,16 +418,16 @@ function LootRollLedger:ProcessLootRoll(msg)
end
end

if not foundActiveMatch then
if foundActiveMatch == false and #self.db.global.activeRolls > 0 then
LootRollLedger:SendRollWarning(name)
end
end

function LootRollLedger:SendRollWarning(playerName)
-- Only send the whisper warning one time
if self.whisperWarnings[playerName] == nil then
SendChatMessage("Your /roll command does not match an active item roll. Please make sure it is correct.", "WHISPER", "Common", playerName)
self.whisperWarnings[playerName] = true
SendChatMessage("Your /roll command does not match an active item roll. Please make sure it is correct.", "WHISPER", "Common", playerName)
end
end

Expand All @@ -446,6 +446,15 @@ function LootRollLedger:CheckForNewRaidLeader()
end
end

function LootRollLedger:IsPlayerInRaidGroup()
local inRaid = UnitInRaid("player")
if inRaid == nil then
return false
else
return true
end
end

-- Determine if the current player is the raid leader or a raid assistant
function LootRollLedger:IsRaidLeader()
if IsPartyLFG and IsPartyLFG() then
Expand All @@ -454,6 +463,9 @@ function LootRollLedger:IsRaidLeader()
if GetNumGroupMembers() == 0 and self.db.profile.debug then
return true -- testing, party of one, testing
end
if LootRollLedger:IsPlayerInRaidGroup() == false then
return false -- don't use in 5-man parties
end
-- Consider the actual leader or someone with assist as a raid leader
return UnitIsGroupLeader("player") or UnitIsGroupAssistant("player")
end
Expand Down

0 comments on commit d1ff561

Please sign in to comment.