|
@@ -6177,11 +6177,11 @@ void clif_displaymessage(const int fd, const char* mes)
|
|
message = aStrdup(mes);
|
|
message = aStrdup(mes);
|
|
line = strtok(message, "\n");
|
|
line = strtok(message, "\n");
|
|
|
|
|
|
|
|
+ while(line != NULL) {
|
|
#if PACKETVER == 20141022
|
|
#if PACKETVER == 20141022
|
|
/** for some reason game client crashes depending on message pattern (only for this packet) **/
|
|
/** for some reason game client crashes depending on message pattern (only for this packet) **/
|
|
/** so we redirect to ZC_NPC_CHAT **/
|
|
/** so we redirect to ZC_NPC_CHAT **/
|
|
//clif_messagecolor(&sd->bl, color_table[COLOR_DEFAULT], mes, false, SELF);
|
|
//clif_messagecolor(&sd->bl, color_table[COLOR_DEFAULT], mes, false, SELF);
|
|
- while(line != NULL) {
|
|
|
|
unsigned long color = (color_table[COLOR_DEFAULT] & 0x0000FF) << 16 | (color_table[COLOR_DEFAULT] & 0x00FF00) | (color_table[COLOR_DEFAULT] & 0xFF0000) >> 16; // RGB to BGR
|
|
unsigned long color = (color_table[COLOR_DEFAULT] & 0x0000FF) << 16 | (color_table[COLOR_DEFAULT] & 0x00FF00) | (color_table[COLOR_DEFAULT] & 0xFF0000) >> 16; // RGB to BGR
|
|
unsigned short len = strnlen(line, CHAT_SIZE_MAX);
|
|
unsigned short len = strnlen(line, CHAT_SIZE_MAX);
|
|
|
|
|
|
@@ -6195,7 +6195,6 @@ void clif_displaymessage(const int fd, const char* mes)
|
|
WFIFOSET(fd, WFIFOW(fd, 2));
|
|
WFIFOSET(fd, WFIFOW(fd, 2));
|
|
}
|
|
}
|
|
#else
|
|
#else
|
|
- while(line != NULL) {
|
|
|
|
// Limit message to 255+1 characters (otherwise it causes a buffer overflow in the client)
|
|
// Limit message to 255+1 characters (otherwise it causes a buffer overflow in the client)
|
|
int len = strnlen(line, CHAT_SIZE_MAX);
|
|
int len = strnlen(line, CHAT_SIZE_MAX);
|
|
|
|
|