summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-08-25 18:24:18 +0200
committerHaru <haru@dotalux.com>2019-10-18 17:41:31 +0200
commitce64fd405d34b42ae2602dbd9345d42fd1dbaef0 (patch)
tree66444567e6c85a57f73c3580054aa78a61f64ff9 /src/char
parent79abae03cea51669df6dda2d006ddb85677916d4 (diff)
downloadhercules-ce64fd405d34b42ae2602dbd9345d42fd1dbaef0.tar.gz
hercules-ce64fd405d34b42ae2602dbd9345d42fd1dbaef0.tar.bz2
hercules-ce64fd405d34b42ae2602dbd9345d42fd1dbaef0.tar.xz
hercules-ce64fd405d34b42ae2602dbd9345d42fd1dbaef0.zip
Fix an issue that caused the saved character data to retain the old party ID after leaving or getting kicked
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char')
-rw-r--r--src/char/int_party.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/char/int_party.c b/src/char/int_party.c
index c27d708f2..bf680c816 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -118,7 +118,6 @@ static void inter_party_calc_state(struct party_data *p)
p->party.exp = 0; //Set off even share.
mapif->party_optionchanged(0, &p->party, 0, 0);
}
- return;
}
// Save party to mysql
@@ -472,8 +471,11 @@ static bool inter_party_leave(int party_id, int account_id, int char_id)
mapif->party_withdraw(party_id, account_id, char_id);
j = p->party.member[i].lv;
- if (p->party.member[i].online > 0)
+ if (p->party.member[i].online > 0) {
+ p->party.member[i].online = 0;
p->party.count--;
+ }
+ inter_party->tosql(&p->party, PS_DELMEMBER, i);
memset(&p->party.member[i], 0, sizeof(struct party_member));
p->size--;
if (j == p->min_lv || j == p->max_lv || p->family) {
@@ -482,7 +484,6 @@ static bool inter_party_leave(int party_id, int account_id, int char_id)
}
if (inter_party->check_empty(p) == 0) {
- inter_party->tosql(&p->party, PS_DELMEMBER, i);
mapif->party_info(-1, &p->party, 0);
}
return true;