From f027d2376f815a7571ca54b65c2372b3debc3004 Mon Sep 17 00:00:00 2001 From: Lynn Date: Tue, 8 Nov 2022 18:55:50 +0100 Subject: [PATCH] Fixed the issue of demoting assists automatically back to member if not listed when manually promoted --- BattlegroundTools.lua | 6 +++++- Changelog.lua | 6 ++++++ PlayerData.lua | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/BattlegroundTools.lua b/BattlegroundTools.lua index dd2f67f..35641d1 100644 --- a/BattlegroundTools.lua +++ b/BattlegroundTools.lua @@ -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 diff --git a/Changelog.lua b/Changelog.lua index 9031f2d..49ecd41 100644 --- a/Changelog.lua +++ b/Changelog.lua @@ -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 = { diff --git a/PlayerData.lua b/PlayerData.lua index e37edd1..5bf0372 100644 --- a/PlayerData.lua +++ b/PlayerData.lua @@ -124,6 +124,8 @@ function Namespace.PlayerData.RebuildRoleData() Memory.MembersData = {} end + Memory.lastKnownGroupType = groupType + local roleChangeEvents = {} local eventIndex = 0 local leader, assists, members = nil, {}, {}