Skip to content

Commit

Permalink
Drop any skill packets from party statistics if we've not yet built t…
Browse files Browse the repository at this point in the history
…he party list
  • Loading branch information
3vcloud committed Jan 6, 2024
1 parent f193318 commit b9be2f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions GWToolboxdll/Windows/PartyStatisticsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand All @@ -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;
Expand All @@ -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;
});
Expand Down

0 comments on commit b9be2f4

Please sign in to comment.