Skip to content

Commit

Permalink
fix: better way to iterate over all members including leader
Browse files Browse the repository at this point in the history
  • Loading branch information
phacUFPE committed Nov 20, 2024
1 parent 1c95d78 commit 7718784
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/creatures/players/grouping/party.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ size_t Party::getInvitationCount() const {
uint8_t Party::getUniqueVocationsCount() const {
std::unordered_set<uint8_t> uniqueVocations;

if (const auto &leader = getLeader(); leader && leader->getVocation()) {
uniqueVocations.insert(leader->getVocation()->getBaseId());
}

for (const auto &player : memberList) {
for (const auto &player : getPlayers()) {
if (uniqueVocations.size() >= 4) {
break;
}
Expand Down

0 comments on commit 7718784

Please sign in to comment.