From b9be2f408cc586892f52bf0515108b392ed62848 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 6 Jan 2024 10:06:57 +0000 Subject: [PATCH] Drop any skill packets from party statistics if we've not yet built the party list --- GWToolboxdll/Windows/PartyStatisticsWindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/GWToolboxdll/Windows/PartyStatisticsWindow.cpp b/GWToolboxdll/Windows/PartyStatisticsWindow.cpp index 25b531e8c..8c3f5f86e 100644 --- a/GWToolboxdll/Windows/PartyStatisticsWindow.cpp +++ b/GWToolboxdll/Windows/PartyStatisticsWindow.cpp @@ -122,6 +122,8 @@ namespace { PartyMember* GetPartyMemberByPartyIdx(const uint32_t party_idx) { + if (pending_party_members) + return nullptr; const auto found = std::ranges::find_if(party_members, [party_idx](const auto party_member) { return party_member->party_idx == party_idx; }); @@ -130,6 +132,8 @@ namespace { PartyMember* GetPartyMemberByAgentId(const uint32_t agent_id) { + if (pending_party_members) + return nullptr; // NB: This function is called on the game thread whenever a skill is used. Would it be much performance difference to keep a std::map for this? const auto found = std::ranges::find_if(party_members, [agent_id](const auto party_member) { return party_member->agent_id == agent_id; @@ -139,6 +143,8 @@ namespace { PartyMember* GetPartyMemberByEncName(const wchar_t* enc_name) { + if (pending_party_members) + return nullptr; const auto found = std::ranges::find_if(party_members, [enc_name](const auto party_member) { return party_member->name_enc == enc_name; });