summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-01-22 19:12:36 +0100
committerHaru <haru@dotalux.com>2015-01-24 14:37:26 +0100
commitd7f99f52e93aded2f0b8802f956f335d7be45a04 (patch)
treec012a2c314157ae13f1e241bf5835a02c3de0f21 /src
parentdf28092eee7f41c2d475c0b122057881eb28da50 (diff)
downloadhercules-d7f99f52e93aded2f0b8802f956f335d7be45a04.tar.gz
hercules-d7f99f52e93aded2f0b8802f956f335d7be45a04.tar.bz2
hercules-d7f99f52e93aded2f0b8802f956f335d7be45a04.tar.xz
hercules-d7f99f52e93aded2f0b8802f956f335d7be45a04.zip
Channels refactoring: map_join
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/map/channel.c25
1 files changed, 12 insertions, 13 deletions
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)