Skip to content

Commit

Permalink
Update council every time group is updated.
Browse files Browse the repository at this point in the history
If a council member joins late, there was no quarantee that they would get picked up by the system, leaving them without voting frame. This ensures the council is updated when the group is, whilst also being a small performance gain.
  • Loading branch information
evil-morfar committed Jan 22, 2025
1 parent 52a13b8 commit a567d79
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Changes


### Bugfixes

- *Council wouldn't always be registered properly.*

# 3.14.5

## Changes
Expand Down
12 changes: 5 additions & 7 deletions ml_core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ function RCLootCouncilML:OnGroupRosterUpdate()
if newGroupSize > self.groupSize then
self.Log:d("Group size changed to "..newGroupSize)
MLDB:Send("group")
self:UpdateGroupCouncil()
self:SendCouncil()
end
self.groupSize = newGroupSize
Expand Down Expand Up @@ -1309,15 +1310,12 @@ end
-- Used by the ML to only send out a council consisting of actual group members.
function RCLootCouncilML:UpdateGroupCouncil()
Council:Set{} -- Set empty
local candidates = addon:UpdateCandidatesInGroup()
for _, guid in ipairs(addon.db.profile.council) do
-- REVIEW: Is all this Player:Get() really efficient?
local player1 = Player:Get(guid)
for cand in addon:GroupIterator() do
local player2 = Player:Get(cand)
if player1 == player2 then
Council:Add(player1)
break
end
local player = Player:Get(guid)
if candidates[player.name] then
Council:Add(player)
end
end
-- Ensure ML (us) are included
Expand Down

0 comments on commit a567d79

Please sign in to comment.