summaryrefslogtreecommitdiff
path: root/src/map/party.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/party.c')
-rw-r--r--src/map/party.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/map/party.c b/src/map/party.c
index 73f85c4..feacc25 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -251,32 +251,44 @@ 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;
- if(sd==NULL || flag==0){
- if(battle_config.error_log)
- printf("party: member added error %d is not online\n",account_id);
- intif_party_leave(party_id,account_id); // キャラ側に登録できなかったため脱退要求を出す
+ struct party *p=party_search(party_id);
+
+ if(sd == NULL){
+ if (flag == 0) {
+ if(battle_config.error_log)
+ printf("party: member added error %d is not online\n",account_id);
+ intif_party_leave(party_id,account_id); // キャラ側に登録できなかったため脱退要求を出す
+ }
return 0;
}
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;
}
// パーティ除名要求