diff options
author | Haru <haru@dotalux.com> | 2017-03-04 20:59:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-04 20:59:58 +0100 |
commit | ce74d8c119facb51a0da92ef965c3dd78994b68f (patch) | |
tree | 8919c873903d969839795c6b718dced32eb0306c /src/char/int_party.c | |
parent | 5adaeca6ff5a5658a1800efa7758ca065ef8621e (diff) | |
parent | 2ce4c3e261f59df22ff23259574b6bfccc11bf3b (diff) | |
download | hercules-ce74d8c119facb51a0da92ef965c3dd78994b68f.tar.gz hercules-ce74d8c119facb51a0da92ef965c3dd78994b68f.tar.bz2 hercules-ce74d8c119facb51a0da92ef965c3dd78994b68f.tar.xz hercules-ce74d8c119facb51a0da92ef965c3dd78994b68f.zip |
Merge pull request #1530 from guilherme-gm/party-leader-leave
Changed behavior when party leader leaves
Diffstat (limited to 'src/char/int_party.c')
-rw-r--r-- | src/char/int_party.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/src/char/int_party.c b/src/char/int_party.c index 2fc39c328..921bf6d9d 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -633,31 +633,21 @@ int mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id) return 0; //Member not found? mapif->party_withdraw(party_id, account_id, char_id); - - if (p->party.member[i].leader){ - p->party.member[i].account_id = 0; - for (j = 0; j < MAX_PARTY; j++) { - if (!p->party.member[j].account_id) - continue; - mapif->party_withdraw(party_id, p->party.member[j].account_id, p->party.member[j].char_id); - p->party.member[j].account_id = 0; - } - //Party gets deleted on the check_empty call below. - } else { - inter_party->tosql(&p->party,PS_DELMEMBER,i); - j = p->party.member[i].lv; - if(p->party.member[i].online) 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) - { - if(p->family) p->family = 0; //Family state broken. - inter_party->check_lv(p); - } + + j = p->party.member[i].lv; + 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) { + if(p->family) p->family = 0; //Family state broken. + inter_party->check_lv(p); } - if (inter_party->check_empty(p) == 0) + if (inter_party->check_empty(p) == 0) { + inter_party->tosql(&p->party, PS_DELMEMBER, i); mapif->party_info(-1, &p->party, 0); + } return 0; } // When member goes to other map or levels up. |