diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-02-01 18:16:09 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-02-01 18:16:09 +0000 |
commit | 2f3928c61a4b13eeb29a0a66802b7d334f319af3 (patch) | |
tree | 4ee808ecf0be9f63f81f220b34f9b1493d219c1e /src/char_sql | |
parent | 78cfbc99e7ecfdc31687009fe33e551b5c852110 (diff) | |
download | hercules-2f3928c61a4b13eeb29a0a66802b7d334f319af3.tar.gz hercules-2f3928c61a4b13eeb29a0a66802b7d334f319af3.tar.bz2 hercules-2f3928c61a4b13eeb29a0a66802b7d334f319af3.tar.xz hercules-2f3928c61a4b13eeb29a0a66802b7d334f319af3.zip |
- 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
Diffstat (limited to 'src/char_sql')
-rw-r--r-- | src/char_sql/int_party.c | 76 |
1 files changed, 41 insertions, 35 deletions
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) { |