summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-03-30 23:08:08 -0300
committershennetsind <ind@henn.et>2013-03-30 23:08:08 -0300
commit7ec1e8fdff6adad1979d750774f9003f223bf3ef (patch)
tree65553e83135c5f5f983c106914d0a35ea2f62588 /src/map/map.c
parent87373047cd4aaf8b0c2425133b9b907e3ea4d122 (diff)
downloadhercules-7ec1e8fdff6adad1979d750774f9003f223bf3ef.tar.gz
hercules-7ec1e8fdff6adad1979d750774f9003f223bf3ef.tar.bz2
hercules-7ec1e8fdff6adad1979d750774f9003f223bf3ef.tar.xz
hercules-7ec1e8fdff6adad1979d750774f9003f223bf3ef.zip
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 <ind@henn.et>
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c38
1 files changed, 28 insertions, 10 deletions
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();