summaryrefslogtreecommitdiff
path: root/src/char/int_party.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-08 23:03:06 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-08 23:03:06 +0000
commit133d6e1686771a4acda5dc421499199528196e0c (patch)
tree24e530c7a9256f1845685c1799b14cd6c03d4cc5 /src/char/int_party.c
parenta0046ed8734160aaaf8ce8afbebee81eb537cbbf (diff)
downloadhercules-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/int_party.c')
-rw-r--r--src/char/int_party.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/src/char/int_party.c b/src/char/int_party.c
index 50d6b0d6a..64facec47 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -519,36 +519,39 @@ 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 = idb_get(party_db, party_id);
- if (p == NULL || p->size == MAX_PARTY) {
+ if( p == NULL || p->size == MAX_PARTY ) {
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 == 0) {
- 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);
- return 0;
- }
+ 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;
}
- mapif_party_memberadded(fd, party_id, member->account_id, member->char_id, 1);
+
+ 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);
return 0;
}