summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/char/int_party.c6
-rw-r--r--src/map/party.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/char/int_party.c b/src/char/int_party.c
index df1d339cf..43583828d 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -639,7 +639,8 @@ int mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id)
inter_party->tosql(&p->party,PS_DELMEMBER,i);
j = p->party.member[i].lv;
- if (p->party.member[i].online > 0) p->party.count--;
+ if (p->party.member[i].online > 0)
+ p->party.count--;
memset(&p->party.member[i], 0, sizeof(struct party_member));
p->size--;
if (j == p->min_lv || j == p->max_lv || p->family) {
@@ -649,8 +650,7 @@ int mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id)
if (leader) {
// Member was party leader, pick a new leader
- i = 0;
- while (i < MAX_PARTY && p->party.member[i].account_id == 0) i++;
+ ARR_FIND(0, MAX_PARTY, i, p->party.member[i].account_id != 0);
if (i < MAX_PARTY) {
// Update party's leader
diff --git a/src/map/party.c b/src/map/party.c
index aad38efa5..0a5b791fe 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -306,7 +306,7 @@ int party_recv_info(const struct party *sp, int char_id)
// Leader has changed
int k;
ARR_FIND(0, MAX_PARTY, k, sp->member[k].leader == 1);
- if (i < MAX_PARTY) {
+ if (k < MAX_PARTY) {
clif->PartyLeaderChanged(map->id2sd(sp->member[k].account_id), 0, sp->member[k].account_id);
} else {
party->broken(p->party.party_id); // Should not happen, Party is leaderless, disband