From 7ec1e8fdff6adad1979d750774f9003f223bf3ef Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 30 Mar 2013 23:08:08 -0300 Subject: Hercules Renewal: clif.c complete Added the last missing functions into the interface, all functions in clif.c are now wired to the interface. http://hercules.ws/board/topic/237-hercules-renewal/ Also shortened clif->displaymessage to clif->message, removed the old clif->message and merged its functionality with clif->disp_overhead (both use the same packet and do the same thing :P) - and a gazillion other stuff: http://hercules.ws/board/topic/316-introducing-hercules-channel-system/ Signed-off-by: shennetsind --- src/map/map.c | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) (limited to 'src/map/map.c') diff --git a/src/map/map.c b/src/map/map.c index 25bc331fa..db933c2dd 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -83,10 +83,6 @@ char log_db_pw[32] = "ragnarok"; char log_db_db[32] = "log"; Sql* logmysql_handle; -// This param using for sending mainchat -// messages like whispers to this nick. [LuzZza] -char main_chat_nick[16] = "Main"; - char *INTER_CONF_NAME; char *LOG_CONF_NAME; char *MAP_CONF_NAME; @@ -1701,10 +1697,33 @@ int map_quit(struct map_session_data *sd) { unit_remove_map(&sd->ed->bl,CLR_TELEPORT); } + if( hChSys.ally && sd->status.guild_id ) { + struct guild *g = sd->guild, *sg; + if( g ) { + if( idb_exists(((struct hChSysCh *)g->channel)->users, sd->status.char_id) ) + clif->chsys_left((struct hChSysCh *)g->channel,sd); + for (i = 0; i < MAX_GUILDALLIANCE; i++) { + if( g->alliance[i].guild_id && (sg = guild_search(g->alliance[i].guild_id) ) ) { + if( idb_exists(((struct hChSysCh *)sg->channel)->users, sd->status.char_id) ) + clif->chsys_left((struct hChSysCh *)sg->channel,sd); + break; + } + } + } + } + + if( sd->channel_count ) { + for( i = 0; i < sd->channel_count; i++ ) { + if( sd->channels[i] != NULL ) + clif->chsys_left(sd->channels[i],sd); + } + if( hChSys.closing ) + aFree(sd->channels); + } + unit_remove_map_pc(sd,CLR_TELEPORT); - if( map[sd->bl.m].instance_id ) - { // Avoid map conflicts and warnings on next login + if( map[sd->bl.m].instance_id ) { // Avoid map conflicts and warnings on next login int16 m; struct point *pt; if( map[sd->bl.m].save.map ) @@ -2950,7 +2969,8 @@ void do_final_maps(void) { } map[i].skill_count = 0; } - + if( map[i].channel ) + clif->chsys_delete(map[i].channel); } map_zone_db_clear(); @@ -3435,9 +3455,6 @@ int inter_config_read(char *cfgName) if( sscanf(line,"%[^:]: %[^\r\n]",w1,w2) < 2 ) continue; - if(strcmpi(w1, "main_chat_nick")==0) - safestrncpy(main_chat_nick, w2, sizeof(main_chat_nick)); - else if(strcmpi(w1,"item_db_db")==0) strcpy(item_db_db,w2); else @@ -3924,6 +3941,7 @@ void do_final(void) struct s_mapiterator* iter; ShowStatus("Terminating...\n"); + hChSys.closing = true; //Ladies and babies first. iter = mapit_getallusers(); -- cgit v1.2.3-60-g2f50