summaryrefslogtreecommitdiff
path: root/src/map/party.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-09 20:11:14 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-09 20:11:14 +0000
commit203b881a3f76e822a0052e58c67bf46ba6ad0596 (patch)
tree9f918bdf4a68aa659f3c5c45186e198cbe2388b5 /src/map/party.c
parenta3e718b798e8b7c5848b58a7646a783ac0163364 (diff)
downloadhercules-203b881a3f76e822a0052e58c67bf46ba6ad0596.tar.gz
hercules-203b881a3f76e822a0052e58c67bf46ba6ad0596.tar.bz2
hercules-203b881a3f76e822a0052e58c67bf46ba6ad0596.tar.xz
hercules-203b881a3f76e822a0052e58c67bf46ba6ad0596.zip
- Modified attack_walk_delay so it behaves on a 'per-object' basis, and changed the default to 15 (all types).
- Modified battle_delay_damage so damage is not delayed more than one second for non-player attacks. - Modified party_member_added with a hack so that the clif functions will send the info of the new member since party_recv_info has not yet arrived. - Updated clif_calc_delay so the type sent to the client is based on the number of hits of the skill (as Aegis packets reveal) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12332 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/party.c')
-rw-r--r--src/map/party.c48
1 files changed, 28 insertions, 20 deletions
diff --git a/src/map/party.c b/src/map/party.c
index 7707ddca3..be89f6345 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -372,7 +372,6 @@ int party_member_added(int party_id,int account_id,int char_id, int flag)
{
struct map_session_data *sd = map_id2sd(account_id),*sd2;
struct party_data *p = party_search(party_id);
- int invite_aid;
int i;
if(sd == NULL || sd->status.char_id != char_id){
@@ -381,7 +380,10 @@ int party_member_added(int party_id,int account_id,int char_id, int flag)
return 0;
}
- invite_aid = sd->party_invite_account;
+ sd2 = map_id2sd(sd->party_invite_account);
+ if( sd2 != NULL )
+ clif_party_inviteack(sd2,sd->status.name,flag?3:2);
+
sd->party_invite = 0;
sd->party_invite_account = 0;
@@ -391,26 +393,32 @@ int party_member_added(int party_id,int account_id,int char_id, int flag)
return 0;
}
- if( flag == 0 ) {
- sd->status.party_id = party_id;
- party_check_conflict(sd);
- clif_party_option(p,sd,0x100);
- clif_party_info(p,sd);
- clif_party_member_info(p,sd);
- for( i = 0; i < ARRAYLENGTH(p->data); ++i )
- {// hp of the other party members
- sd2 = p->data[i].sd;
- if( sd2 && sd2->status.account_id != account_id && sd2->status.char_id != char_id )
- clif_hpmeter_single(sd->fd, sd2->bl.id, sd2->battle_status.hp, sd2->battle_status.max_hp);
- }
- clif_party_hp(sd);
- clif_party_xy(sd);
- clif_charnameupdate(sd); //Update char name's display [Skotlex]
+ if( flag ) return 0;
+
+ sd->status.party_id = party_id;
+
+ ARR_FIND( 0, MAX_PARTY, i, p->party.member[i].account_id == 0 );
+ if (i < MAX_PARTY) {
+ //TODO: This is a hack to allow the following clif calls to send the data to the new player.
+ //The correct player data is set when party_recv_info arrives soon afterwards.
+ party_fill_member(&p->party.member[i], sd);
+ p->data[i].sd = sd;
}
- sd2 = map_id2sd(invite_aid);
- if( sd2 != NULL )
- clif_party_inviteack(sd2,sd->status.name,flag?2:1);
+ party_check_conflict(sd);
+ clif_party_option(p,sd,0x100);
+ clif_party_info(p,sd);
+ clif_party_member_info(p,sd);
+ for( i = 0; i < ARRAYLENGTH(p->data); ++i )
+ {// hp of the other party members
+ sd2 = p->data[i].sd;
+ if( sd2 && sd2->status.account_id != account_id && sd2->status.char_id != char_id )
+ clif_hpmeter_single(sd->fd, sd2->bl.id, sd2->battle_status.hp, sd2->battle_status.max_hp);
+ }
+ clif_party_hp(sd);
+ clif_party_xy(sd);
+ clif_charnameupdate(sd); //Update char name's display [Skotlex]
+
return 0;
}