diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-03-08 23:03:06 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-03-08 23:03:06 +0000 |
commit | 133d6e1686771a4acda5dc421499199528196e0c (patch) | |
tree | 24e530c7a9256f1845685c1799b14cd6c03d4cc5 /src/char_sql | |
parent | a0046ed8734160aaaf8ce8afbebee81eb537cbbf (diff) | |
download | hercules-133d6e1686771a4acda5dc421499199528196e0c.tar.gz hercules-133d6e1686771a4acda5dc421499199528196e0c.tar.bz2 hercules-133d6e1686771a4acda5dc421499199528196e0c.tar.xz hercules-133d6e1686771a4acda5dc421499199528196e0c.zip |
Corrected a problem where a party invite acknowledgement would not be sent (bugreport:1091).
There is still the unresolved issue where newly added party members will not display their party correctly.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12328 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r-- | src/char_sql/int_party.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/src/char_sql/int_party.c b/src/char_sql/int_party.c index cff17c5b5..a51b8def0 100644 --- a/src/char_sql/int_party.c +++ b/src/char_sql/int_party.c @@ -535,42 +535,43 @@ int mapif_parse_PartyInfo(int fd,int party_id) return 0; } // パーティ追加要求 -int mapif_parse_PartyAddMember(int fd, int party_id, struct party_member *member) { +int mapif_parse_PartyAddMember(int fd, int party_id, struct party_member *member) +{ struct party_data *p; int i; p = inter_party_fromsql(party_id); + if( p == NULL || p->size == MAX_PARTY ) { + mapif_party_memberadded(fd, party_id, member->account_id, member->char_id, 1); + return 0; + } - if(!p || p->size == MAX_PARTY){ - mapif_party_memberadded(fd,party_id,member->account_id,member->char_id,1); + ARR_FIND( 0, MAX_PARTY, i, p->party.member[i].account_id == 0 ); + if( i == MAX_PARTY ) + {// Party full + mapif_party_memberadded(fd, party_id, member->account_id, member->char_id, 1); return 0; } - for(i=0;i<MAX_PARTY;i++){ - if(p->party.member[i].account_id) - continue; + memcpy(&p->party.member[i], member, sizeof(struct party_member)); + p->party.member[i].leader = 0; + if (p->party.member[i].online) p->party.count++; + p->size++; + if (p->size == 3) //Check family state. + int_party_calc_state(p); + else //Check even share range. + if (member->lv < p->min_lv || member->lv > p->max_lv || p->family) { + if (p->family) p->family = 0; //Family state broken. + int_party_check_lv(p); + } - memcpy(&p->party.member[i], member, sizeof(struct party_member)); - p->party.member[i].leader=0; - if (p->party.member[i].online) p->party.count++; - p->size++; - if (p->size == 3) //Check family state. - int_party_calc_state(p); - else //Check even share range. - if (member->lv < p->min_lv || member->lv > p->max_lv || p->family) { - if (p->family) p->family = 0; //Family state broken. - int_party_check_lv(p); - } + mapif_party_memberadded(fd, party_id, member->account_id, member->char_id, 0); + mapif_party_info(-1, &p->party); + inter_party_tosql(&p->party, PS_ADDMEMBER, i); - mapif_party_memberadded(fd,party_id,member->account_id,member->char_id,0); - mapif_party_info(-1,&p->party); - inter_party_tosql(&p->party, PS_ADDMEMBER, i); - return 0; - } - //Party full - mapif_party_memberadded(fd,party_id,member->account_id,member->char_id,1); return 0; } + // パーティー設定変更要求 int mapif_parse_PartyChangeOption(int fd,int party_id,int account_id,int exp,int item) { |