Skip to content

Commit

Permalink
Fixed the issue of demoting assists automatically back to member if n…
Browse files Browse the repository at this point in the history
…ot listed when manually promoted
  • Loading branch information
linaori committed Nov 8, 2022
1 parent 0685fc4 commit f027d23
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion BattlegroundTools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,16 @@ end
--- this listener in specific deals with new members becoming assistant
function Private.PromoteNewMemberToAssistantListener(playerData, oldRole, newRole)
if oldRole or newRole ~= Role.Member or playerData.units.player then return end

local leaderTools = Namespace.Database.profile.BattlegroundTools.LeaderTools
if not leaderTools.promoteListed then return end

if not Private.PlayerIsInBattleground() or GetGroupType() ~= GroupType.InstanceRaid then return end

local leader = GetGroupLeaderData()
if not leader or not leader.units.player then return end

if Namespace.Database.profile.BattlegroundTools.LeaderTools.automaticAssist[playerData.name] then
if leaderTools.automaticAssist[playerData.name] then
PromoteToAssistant(playerData.name)
end
end
Expand Down
6 changes: 6 additions & 0 deletions Changelog.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
local _, Namespace = ...

Namespace.Changelog = {
{
version = '10.0.0-7',
bugs = {
'Fixed the issue of demoting assists automatically back to member if not listed when manually promoted',
},
},
{
version = '10.0.0-6',
improvements = {
Expand Down
2 changes: 2 additions & 0 deletions PlayerData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ function Namespace.PlayerData.RebuildRoleData()
Memory.MembersData = {}
end

Memory.lastKnownGroupType = groupType

local roleChangeEvents = {}
local eventIndex = 0
local leader, assists, members = nil, {}, {}
Expand Down

0 comments on commit f027d23

Please sign in to comment.