From 5b3ab59b7c5d1cd14ad764b83d831f12f263edc0 Mon Sep 17 00:00:00 2001 From: hg <4683435+hgtw@users.noreply.github.com> Date: Fri, 11 Jun 2021 14:31:25 -0400 Subject: [PATCH] [Expeditions] Avoid expedition leader change if only member (#1372) This fixes an edge case where a player could be made leader when added to an expedition that only had a single member previously. If a leader in a two-member expedition quit (forcing a leader change) and the new leader went offline while throttled, a leader change flag would be set until a non-leader was available. The first added member would then be made the new leader. This could also potentially occur on world startup due to the initial throttle timer state but member statuses aren't processed there yet --- world/expedition.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/world/expedition.cpp b/world/expedition.cpp index 4b29e4f0a..4cc82ca03 100644 --- a/world/expedition.cpp +++ b/world/expedition.cpp @@ -182,7 +182,7 @@ void Expedition::UpdateMemberStatus(uint32_t character_id, DynamicZoneMemberStat } // any member status update will trigger a leader fix if leader was offline - if (m_leader.status == DynamicZoneMemberStatus::Offline) + if (m_leader.status == DynamicZoneMemberStatus::Offline && GetDynamicZone().GetMemberCount() > 1) { ChooseNewLeader(); }