summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDennis Friis <peavey@inspircd.org>2009-06-28 14:34:18 +0200
committerDennis Friis <peavey@inspircd.org>2009-06-28 14:38:57 +0200
commit381151eb83dbfb753b6cbb031546fd2d4a828f69 (patch)
tree21bf38a060264ba41841abec197fd8aefa73f5f5 /src
parent569c7674349ba86822b648060ac01de129c31d37 (diff)
downloadtmwa-381151eb83dbfb753b6cbb031546fd2d4a828f69.tar.gz
tmwa-381151eb83dbfb753b6cbb031546fd2d4a828f69.tar.bz2
tmwa-381151eb83dbfb753b6cbb031546fd2d4a828f69.tar.xz
tmwa-381151eb83dbfb753b6cbb031546fd2d4a828f69.zip
Check party exists on add, reset party info so it shows on adding member.
Inspired by ea stable.
Diffstat (limited to 'src')
-rw-r--r--src/map/party.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/map/party.c b/src/map/party.c
index 7f5605c..feacc25 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -251,6 +251,8 @@ int party_reply_invite(struct map_session_data *sd,int account_id,int flag)
int party_member_added(int party_id,int account_id,int flag)
{
struct map_session_data *sd= map_id2sd(account_id),*sd2;
+ struct party *p=party_search(party_id);
+
if(sd == NULL){
if (flag == 0) {
if(battle_config.error_log)
@@ -262,23 +264,31 @@ int party_member_added(int party_id,int account_id,int flag)
sd2=map_id2sd(sd->party_invite_account);
sd->party_invite=0;
sd->party_invite_account=0;
-
+
+ if (p==NULL) {
+ printf("party_member_added: party %d not found.\n",party_id);
+ intif_party_leave(party_id,account_id);
+ return 0;
+ }
+
if(flag==1){ // 失敗
if( sd2!=NULL )
clif_party_inviteack(sd2,sd->status.name,0);
return 0;
}
-
- // 成功
+
+ // 成功
sd->party_sended=0;
sd->status.party_id=party_id;
-
+
if( sd2!=NULL)
clif_party_inviteack(sd2,sd->status.name,2);
// いちおう競合確認
party_check_conflict(sd);
+ party_send_xy_clear(p);
+
return 0;
}
// パーティ除名要求