Skip to content

Commit

Permalink
Simplify IsPlayerInParty
Browse files Browse the repository at this point in the history
(cherry picked from commit 0c7f16f)
  • Loading branch information
adituv authored and 3vcloud committed Aug 4, 2023
1 parent d4053a0 commit 7192043
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions GWToolboxdll/Utils/ToolboxUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,15 @@ namespace ToolboxUtils {

bool IsPlayerInParty(const uint32_t login_number)
{
GW::PartyInfo* party = nullptr;
return GetPlayerPartyMember(login_number, &party) && party == GW::PartyMgr::GetPartyInfo();
GW::PartyContext* partyContext = GW::GetPartyContext();
GW::PartyInfo* playerParty = partyContext->player_party;

for (const auto& player : playerParty->players) {
if (player.login_number == login_number)
return true;
}

return false;
}

bool IsAgentInParty(const uint32_t agent_id)
Expand Down

0 comments on commit 7192043

Please sign in to comment.