From cd98b8bc6f29268cabed1e1922e7396e69c106d4 Mon Sep 17 00:00:00 2001 From: hg <4683435+hgtw@users.noreply.github.com> Date: Sun, 4 Oct 2020 18:45:16 -0400 Subject: [PATCH] Only send member updates after caching dz data This fixes characters not receiving a compass if they're already in the compass zone when an expedition is created from another zone --- zone/expedition.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/zone/expedition.cpp b/zone/expedition.cpp index 2eafa1dbe..4ff049de3 100644 --- a/zone/expedition.cpp +++ b/zone/expedition.cpp @@ -163,7 +163,6 @@ void Expedition::CacheExpeditions(MySQLRequestResult& results) using col = LoadExpeditionColumns::eLoadExpeditionColumns; - Expedition* current_expedition = nullptr; uint32_t last_expedition_id = 0; for (auto row = results.begin(); row != results.end(); ++row) @@ -172,12 +171,6 @@ void Expedition::CacheExpeditions(MySQLRequestResult& results) if (expedition_id != last_expedition_id) { - // finished parsing previous expedition members, send member updates - if (current_expedition) - { - current_expedition->SendUpdatesToZoneMembers(); - } - expedition_ids.emplace_back(expedition_id); uint32_t leader_id = strtoul(row[col::leader_id], nullptr, 10); @@ -209,7 +202,7 @@ void Expedition::CacheExpeditions(MySQLRequestResult& results) last_expedition_id = expedition_id; // looping expedition members - current_expedition = Expedition::FindCachedExpeditionByID(last_expedition_id); + auto current_expedition = Expedition::FindCachedExpeditionByID(last_expedition_id); if (current_expedition) { auto member_id = strtoul(row[col::member_id], nullptr, 10); @@ -219,12 +212,6 @@ void Expedition::CacheExpeditions(MySQLRequestResult& results) } } - // update for the last cached expedition - if (current_expedition) - { - current_expedition->SendUpdatesToZoneMembers(); - } - // ask world for online members from all cached expeditions at once Expedition::SendWorldGetOnlineMembers(expedition_character_ids); @@ -248,6 +235,9 @@ void Expedition::CacheExpeditions(MySQLRequestResult& results) { expedition->m_lockouts = lockout_iter->second; } + + // send member updates now that all data is loaded for the cached expedition(s) + expedition->SendUpdatesToZoneMembers(); } } }