From ef7452b497d24f6f475d214f1244ab589b304c7c Mon Sep 17 00:00:00 2001 From: zephyrus Date: Sat, 20 Jun 2009 17:56:01 +0000 Subject: - Instancing System (Thanks to Sirius White who did most of the code, with some of my work to implement client side information, some optimizations and bugfixes). Also thanks to contributions from UEAUP team and Orcao. - Fixed a bug on areamobuseskill and changed it to make it as Aegis. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13901 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/party.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/map/party.c') diff --git a/src/map/party.c b/src/map/party.c index 46ddf2952..a71344ed7 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -46,6 +46,17 @@ static void party_fill_member(struct party_member *member, struct map_session_da member->leader = 0; } +/*========================================== + * Request an available sd of this party + *------------------------------------------*/ +struct map_session_data* party_getavailablesd(struct party_data *p) +{ + int i; + nullpo_retr(NULL, p); + ARR_FIND(0, MAX_PARTY, i, p->data[i].sd != NULL); + return( i < MAX_PARTY ) ? p->data[i].sd : NULL; +} + /*========================================== * Retrieves and validates the sd pointer for this party member [Skotlex] *------------------------------------------*/ @@ -385,7 +396,11 @@ void party_member_joined(struct map_session_data *sd) } ARR_FIND( 0, MAX_PARTY, i, p->party.member[i].account_id == sd->status.account_id && p->party.member[i].char_id == sd->status.char_id ); if (i < MAX_PARTY) + { p->data[i].sd = sd; + if( p->instance_id ) + clif_instance_join(sd->fd,p->instance_id); + } else sd->status.party_id = 0; //He does not belongs to the party really? } @@ -450,6 +465,9 @@ int party_member_added(int party_id,int account_id,int char_id, int flag) clif_party_xy(sd); clif_charnameupdate(sd); //Update char name's display [Skotlex] + if( p->instance_id ) + clif_instance_join(sd->fd, p->instance_id); + return 0; } @@ -521,7 +539,10 @@ int party_member_leaved(int party_id, int account_id, int char_id) sd->status.party_id = 0; clif_charnameupdate(sd); //Update name display [Skotlex] //TODO: hp bars should be cleared too + if( p->instance_id ) + map_instance_check_kick(sd); } + return 0; } @@ -534,6 +555,9 @@ int party_broken(int party_id) p = party_search(party_id); if( p == NULL ) return 0; + + if( p->instance_id ) + map_instance_destroy( p->instance_id ); for(i=0;idata[i].sd!=NULL){ -- cgit v1.2.3-70-g09d2