summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-06-02 02:31:46 +0200
committerHaru <haru@dotalux.com>2015-06-02 02:31:46 +0200
commit517d94e322185ae62ffbc3f3ba55ea6846bfe684 (patch)
tree362f346bf710808a9b6367b8375b2505a065f2e4
parent60e499282e124cd8978a32bb84d4b394811f29dc (diff)
downloadhercules-517d94e322185ae62ffbc3f3ba55ea6846bfe684.tar.gz
hercules-517d94e322185ae62ffbc3f3ba55ea6846bfe684.tar.bz2
hercules-517d94e322185ae62ffbc3f3ba55ea6846bfe684.tar.xz
hercules-517d94e322185ae62ffbc3f3ba55ea6846bfe684.zip
Follow-up to 544a75b
Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--src/map/atcommand.c6
-rw-r--r--src/map/channel.c1
-rw-r--r--src/map/clif.c10
3 files changed, 10 insertions, 7 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 0bd236fa7..95d1729e7 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -8785,7 +8785,7 @@ ACMD(channel) {
unsigned short msg_len = 1;
msg_len += sprintf(mout, "[ %s list colors ] : %s", command, channel->config->colors_name[k]);
- clif->colormes( fd, (enum clif_colors)channel->config->colors[k], mout );
+ clif->messagecolor_self(fd, channel->config->colors[k], mout);
}
} else {
DBIterator *iter = db_iterator(channel->db);
@@ -9171,7 +9171,7 @@ ACMD(fontcolor) {
for( k = 0; k < channel->config->colors_count; k++ ) {
msg_len += sprintf(mout, "[ %s ] : %s", command, channel->config->colors_name[k]);
- clif->colormes( fd, (enum clif_colors)channel->config->colors[k], mout );
+ clif->messagecolor_self(fd, channel->config->colors[k], mout);
}
return false;
}
@@ -9194,7 +9194,7 @@ ACMD(fontcolor) {
sd->fontcolor = k + 1;
msg_len += sprintf(mout, "Color changed to '%s'", channel->config->colors_name[k]);
- clif->colormes( fd, (enum clif_colors)channel->config->colors[k], mout );
+ clif->messagecolor_self(fd, channel->config->colors[k], mout);
return true;
}
diff --git a/src/map/channel.c b/src/map/channel.c
index 7b9dce4ea..f7ab978a6 100644
--- a/src/map/channel.c
+++ b/src/map/channel.c
@@ -693,7 +693,6 @@ void read_channels_config(void)
safestrncpy(channel->config->colors_name[i], config_setting_name(color), HCS_NAME_LENGTH);
channel->config->colors[i] = (unsigned int)strtoul(libconfig->setting_get_string_elem(colors,i),NULL,0);
- channel->config->colors[i] = (channel->config->colors[i] & 0x0000FF) << 16 | (channel->config->colors[i] & 0x00FF00) | (channel->config->colors[i] & 0xFF0000) >> 16;//RGB to BGR
}
channel->config->colors_count = color_count;
}
diff --git a/src/map/clif.c b/src/map/clif.c
index ea72acb7f..a8fa2e6e7 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8892,12 +8892,13 @@ void clif_channel_msg(struct channel_data *chan, struct map_session_data *sd, ch
DBIterator *iter = db_iterator(chan->users);
struct map_session_data *user;
unsigned short msg_len = strlen(msg) + 1;
+ uint32 color = channel->config->colors[chan->color];
WFIFOHEAD(sd->fd,msg_len + 12);
WFIFOW(sd->fd,0) = 0x2C1;
WFIFOW(sd->fd,2) = msg_len + 12;
WFIFOL(sd->fd,4) = 0;
- WFIFOL(sd->fd,8) = channel->config->colors[chan->color];
+ WFIFOL(sd->fd,8) = RGB2BGR(color);
safestrncpy((char*)WFIFOP(sd->fd,12), msg, msg_len);
for (user = dbi_first(iter); dbi_exists(iter); user = dbi_next(iter)) {
@@ -8919,11 +8920,12 @@ void clif_channel_msg2(struct channel_data *chan, char *msg)
struct map_session_data *user;
unsigned char buf[210];
unsigned short msg_len = strlen(msg) + 1;
+ uint32 color = channel->config->colors[chan->color];
WBUFW(buf,0) = 0x2C1;
WBUFW(buf,2) = msg_len + 12;
WBUFL(buf,4) = 0;
- WBUFL(buf,8) = channel->config->colors[chan->color];
+ WBUFL(buf,8) = RGB2BGR(color);
safestrncpy((char*)WBUFP(buf,12), msg, msg_len);
for (user = dbi_first(iter); dbi_exists(iter); user = dbi_next(iter)) {
@@ -9674,6 +9676,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
} else if ( sd->fontcolor && !sd->chatID ) {
char mout[200];
unsigned char mylen = 1;
+ uint32 color = 0;
if( sd->disguise == -1 ) {
sd->fontcolor_tid = timer->add(timer->gettick()+5000, clif->undisguise_timer, sd->bl.id, 0);
@@ -9691,11 +9694,12 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
mylen += snprintf(mout, 200, "%s : %s",sd->fakename[0]?sd->fakename:sd->status.name,message);
+ color = channel->config->colors[sd->fontcolor - 1];
WFIFOHEAD(fd,mylen + 12);
WFIFOW(fd,0) = 0x2C1;
WFIFOW(fd,2) = mylen + 12;
WFIFOL(fd,4) = sd->bl.id;
- WFIFOL(fd,8) = channel->config->colors[sd->fontcolor - 1];
+ WFIFOL(fd,8) = RGB2BGR(color);
safestrncpy((char*)WFIFOP(fd,12), mout, mylen);
clif->send(WFIFOP(fd,0), WFIFOW(fd,2), &sd->bl, AREA_WOS);
WFIFOL(fd,4) = -sd->bl.id;