diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 18 | ||||
-rw-r--r-- | src/map/guild.c | 90 | ||||
-rw-r--r-- | src/map/party.c | 8 |
3 files changed, 63 insertions, 53 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 80e863483..456667a32 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8012,15 +8012,6 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) clif_updatestatus(sd,SP_MAXWEIGHT); clif_updatestatus(sd,SP_WEIGHT); - if(battle_config.pc_invincible_time > 0) { - if(map_flag_gvg(sd->bl.m)) - pc_setinvincibletimer(sd,battle_config.pc_invincible_time<<1); - else - pc_setinvincibletimer(sd,battle_config.pc_invincible_time); - } - map_addblock(&sd->bl); // ubNo^ - clif_spawn(&sd->bl); // spawn - // Party if(sd->status.party_id) { party_send_movemap(sd); @@ -8031,6 +8022,15 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) if(sd->status.guild_id) guild_send_memberinfoshort(sd,1); + if(battle_config.pc_invincible_time > 0) { + if(map_flag_gvg(sd->bl.m)) + pc_setinvincibletimer(sd,battle_config.pc_invincible_time<<1); + else + pc_setinvincibletimer(sd,battle_config.pc_invincible_time); + } + map_addblock(&sd->bl); // ubNo^ + clif_spawn(&sd->bl); // spawn + if(map[sd->bl.m].flag.pvp) { if(!battle_config.pk_mode) { // remove pvp stuff for pk_mode [Valaris] if (!map[sd->bl.m].flag.pvp_nocalcrank) diff --git a/src/map/guild.c b/src/map/guild.c index c6dbe7515..57582b470 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -715,10 +715,10 @@ int guild_reply_invite(struct map_session_data *sd,int guild_id,int flag) return 0; } - //interIΦΗΑv guild_makemember(&m,sd); intif_guild_addmember( sd->guild_invite, &m ); + //TODO: send a minimap update to this player return 0; }else{ // Ϋ sd->guild_invite=0; @@ -756,8 +756,10 @@ int guild_member_added(int guild_id,int account_id,int char_id,int flag) } // ¬χ - sd->state.guild_sent=0; - sd->status.guild_id=guild_id; + sd->state.guild_sent = 0; + sd->status.guild_id = g->guild_id; + sd->guild_emblem_id = g->emblem_id; + //TODO: send new emblem info to others if( sd2!=NULL ) clif_guild_inviteack(sd2,2); @@ -770,8 +772,7 @@ int guild_member_added(int guild_id,int account_id,int char_id,int flag) } // MhEήv -int guild_leave(struct map_session_data *sd,int guild_id, - int account_id,int char_id,const char *mes) +int guild_leave(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes) { struct guild *g; @@ -790,9 +791,9 @@ int guild_leave(struct map_session_data *sd,int guild_id, intif_guild_leave(sd->status.guild_id, sd->status.account_id, sd->status.char_id,0,mes); return 0; } + // MhΗϊv -int guild_expulsion(struct map_session_data *sd,int guild_id, - int account_id,int char_id,const char *mes) +int guild_expulsion(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes) { struct map_session_data *tsd; struct guild *g; @@ -829,47 +830,51 @@ int guild_expulsion(struct map_session_data *sd,int guild_id, return 0; } -int guild_member_leaved(int guild_id,int account_id,int char_id,int flag, - const char *name,const char *mes) // rewrote [LuzZza] +int guild_member_leaved(int guild_id, int account_id, int char_id, int flag, const char* name, const char* mes) { int i; - struct guild *g = guild_search(guild_id); - struct map_session_data *sd = map_charid2sd(char_id); - struct map_session_data *online_member_sd; + struct guild* g = guild_search(guild_id); + struct map_session_data* sd = map_charid2sd(char_id); + struct map_session_data* online_member_sd; if(g == NULL) - return 0; + return 0; // no such guild (error!) - for(i=0;i<g->max_member;i++) { - if( g->member[i].account_id == account_id && - g->member[i].char_id == char_id ){ - - if((online_member_sd = guild_getavailablesd(g)) == NULL) - return 0; - - if(!flag) - clif_guild_leave(online_member_sd, name, mes); - else - clif_guild_expulsion(online_member_sd, name, mes, account_id); - - memset(&g->member[i],0,sizeof(struct guild_member)); - clif_guild_memberlist(online_member_sd); - - if(sd != NULL && sd->status.guild_id == guild_id) { - if (sd->state.storage_flag == 2) //Close the guild storage. - storage_guild_storageclose(sd); - sd->status.guild_id=0; - sd->guild_emblem_id=0; - sd->state.guild_sent=0; - - guild_send_dot_remove(sd); - clif_charnameupdate(sd); //Update display name [Skotlex] - } - return 0; - } - - } + for(i = 0; i < g->max_member; i++) + if( g->member[i].account_id == account_id && g->member[i].char_id == char_id ) + break; + + if (i == g->max_member) + return 0; // not a member (inconsistency!) + + online_member_sd = guild_getavailablesd(g); + if(online_member_sd == NULL) + return 0; // noone online to inform + + if(!flag) + clif_guild_leave(online_member_sd, name, mes); + else + clif_guild_expulsion(online_member_sd, name, mes, account_id); + + // remove member from guild + memset(&g->member[i],0,sizeof(struct guild_member)); + clif_guild_memberlist(online_member_sd); + // update char, if online + if(sd != NULL && sd->status.guild_id == guild_id) + { + // do stuff that needs the guild_id first, BEFORE we wipe it + if (sd->state.storage_flag == 2) //Close the guild storage. + storage_guild_storageclose(sd); + guild_send_dot_remove(sd); + + sd->status.guild_id = 0; + sd->guild_emblem_id = 0; + sd->state.guild_sent = 0; + + clif_charnameupdate(sd); //Update display name [Skotlex] + //TODO: send emblem update to self and people around + } return 0; } @@ -975,6 +980,7 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin continue; clif_guild_xy_single(g->member[idx].sd->fd, g->member[i].sd); + clif_guild_xy_single(g->member[i].sd->fd, g->member[idx].sd); } return 0; diff --git a/src/map/party.c b/src/map/party.c index 4c1f512cd..cac59d2c2 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -427,6 +427,7 @@ int party_member_leaved(int party_id,int account_id,int char_id) sd->status.party_id=0; sd->state.party_sent=0; clif_charnameupdate(sd); //Update name display [Skotlex] + //TODO: hp bars should be cleared too } return 0; } @@ -532,12 +533,15 @@ void party_send_movemap(struct map_session_data *sd) } } - if (sd->fd) { //Send dots of other party members to this char. [Skotlex] + if (sd->fd) { // synchronize minimap positions with the rest of the party for(i=0; i < MAX_PARTY; i++) { - if (p->data[i].sd && + if (p->data[i].sd && p->data[i].sd != sd && p->data[i].sd->bl.m == sd->bl.m) + { clif_party_xy_single(sd->fd, p->data[i].sd); + clif_party_xy_single(p->data[i].sd->fd, sd); + } } } return; |