From 2f3928c61a4b13eeb29a0a66802b7d334f319af3 Mon Sep 17 00:00:00 2001 From: skotlex Date: Thu, 1 Feb 2007 18:16:09 +0000 Subject: - When when a party-member levels up, the level change is sent to the char-server to update the even-share range values. - When joining a gvg_dungeon, the pvp packet will be sent to signal versus. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9759 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/char_sql/int_party.c | 76 ++++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 35 deletions(-) (limited to 'src/char_sql') diff --git a/src/char_sql/int_party.c b/src/char_sql/int_party.c index 025c14e31..7b6b41b23 100644 --- a/src/char_sql/int_party.c +++ b/src/char_sql/int_party.c @@ -716,7 +716,7 @@ int mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id) mapif_party_info(-1,&p->party); return 0; } -// When member goes to other map +// When member goes to other map or levels up. int mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, int char_id, unsigned short map, int online, unsigned int lv) { struct party_data *p; @@ -726,45 +726,51 @@ int mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, int char_id if (p == NULL) return 0; - for(i = 0; i < MAX_PARTY; i++) { - if(p->party.member[i].account_id == account_id && - p->party.member[i].char_id == char_id) + for(i = 0; i < MAX_PARTY && + (p->party.member[i].account_id != account_id || + p->party.member[i].char_id != char_id); i++); + + if (i == MAX_PARTY) return 0; + + if (p->party.member[i].online != online) + { + p->party.member[i].online = online; + if (online) + p->party.count++; + else + p->party.count--; + // Even share check situations: Family state (always breaks) + // character logging on/off is max/min level (update level range) + // or character logging on/off has a different level (update level range using new level) + if (p->family || + (p->party.member[i].lv <= p->min_lv || p->party.member[i].lv >= p->max_lv) || + (p->party.member[i].lv != lv && (lv <= p->min_lv || lv >= p->max_lv)) + ) { - p->party.member[i].map = map; - if (p->party.member[i].online != online) - { - p->party.member[i].online = online; - if (online) - p->party.count++; - else - p->party.count--; - // Even share check situations: Family state (always breaks) - // character logging on/off is max/min level (update level range) - // or character logging on/off has a different level (update level range using new level) - if (p->family || - (p->party.member[i].lv <= p->min_lv || p->party.member[i].lv >= p->max_lv) || - (p->party.member[i].lv != lv && (lv <= p->min_lv || lv >= p->max_lv)) - ) - { - p->party.member[i].lv = lv; - int_party_check_lv(p); - } - } - if (p->party.member[i].lv != lv) { - if(p->party.member[i].lv == p->min_lv || - p->party.member[i].lv == p->max_lv) - { - p->party.member[i].lv = lv; - int_party_check_lv(p); - } else - p->party.member[i].lv = lv; - } - mapif_party_membermoved(&p->party, i); - break; + p->party.member[i].lv = lv; + int_party_check_lv(p); } } + + if (p->party.member[i].lv != lv) { + if(p->party.member[i].lv == p->min_lv || + p->party.member[i].lv == p->max_lv) + { + p->party.member[i].lv = lv; + int_party_check_lv(p); + } else + p->party.member[i].lv = lv; + //There is no need to send level update to map servers + //since they do nothing with it. + } + + if (p->party.member[i].map != map) { + p->party.member[i].map = map; + mapif_party_membermoved(&p->party, i); + } return 0; } + // パーティ解散要求 int mapif_parse_BreakParty(int fd,int party_id) { -- cgit v1.2.3-70-g09d2