From d7f99f52e93aded2f0b8802f956f335d7be45a04 Mon Sep 17 00:00:00 2001 From: Haru Date: Thu, 22 Jan 2015 19:12:36 +0100 Subject: Channels refactoring: map_join Signed-off-by: Haru --- src/map/channel.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src/map/channel.c') diff --git a/src/map/channel.c b/src/map/channel.c index 13286b374..aa7b10ba3 100644 --- a/src/map/channel.c +++ b/src/map/channel.c @@ -350,8 +350,12 @@ enum channel_operation_status channel_join(struct channel_data *chan, struct map if (!silent && !(chan->options&HCS_OPT_ANNOUNCE_JOIN)) { char output[CHAT_SIZE_MAX]; - sprintf(output, msg_txt(1403), chan->name); // You're now in the '%s' channel - clif->message(sd->fd, output); + if (chan->type == HCS_TYPE_MAP) { + sprintf(output, msg_txt(1435), chan->name, map->list[sd->bl.m].name); // You're now in the '#%s' channel for '%s' + } else { + sprintf(output, msg_txt(1403), chan->name); // You're now in the '%s' channel + } + clif->colormes(sd->fd, COLOR_DEFAULT, output); } if (chan->type == HCS_TYPE_ALLY) { @@ -443,6 +447,11 @@ void channel_quit(struct map_session_data *sd) sd->channels = NULL; } +/** + * Joins the local map channel. + * + * @param sd The target character + */ void channel_map_join(struct map_session_data *sd) { if (sd->state.autotrade || sd->state.standalone) @@ -455,17 +464,7 @@ void channel_map_join(struct map_session_data *sd) map->list[sd->bl.m].channel->m = sd->bl.m; } - if (map->list[sd->bl.m].channel->banned && idb_exists(map->list[sd->bl.m].channel->banned, sd->status.account_id)) { - return; - } - - channel->join_sub(map->list[sd->bl.m].channel,sd, false); - - if (!( map->list[sd->bl.m].channel->options & HCS_OPT_ANNOUNCE_JOIN )) { - char mout[60]; - sprintf(mout, msg_txt(1435), channel->config->local_name, map->list[sd->bl.m].name); // You're now in the '#%s' channel for '%s' - clif->colormes(sd->fd, COLOR_DEFAULT, mout); - } + channel->join(map->list[sd->bl.m].channel, sd, NULL, false); } void channel_guild_join(struct guild *g1,struct guild *g2) -- cgit v1.2.3-60-g2f50