瀏覽代碼

Bug Fixes:
* Fixed #484,Client Crashing 2014-10-22

icxbb-xx 10 年之前
父節點
當前提交
0dc5aa4c3c
共有 1 個文件被更改,包括 13 次插入1 次删除
  1. 13 1
      src/map/clif.c

+ 13 - 1
src/map/clif.c

@@ -5760,7 +5760,19 @@ void clif_displaymessage(const int fd, const char* mes)
 #if PACKETVER == 20141022
 		/** for some reason game client crashes depending on message pattern (only for this packet) **/
 		/** so we redirect to ZC_NPC_CHAT **/
-		clif_colormes(fd, color_table[COLOR_DEFAULT], mes);
+		//clif_colormes(fd, color_table[COLOR_DEFAULT], mes);
+		unsigned long color = color_table[COLOR_DEFAULT]; // RGB to BGR
+		int len = strnlen(mes, 255);
+
+		if (len > 0) { 
+			WFIFOHEAD(fd, 13 + len);
+			WFIFOW(fd, 0) = 0x2C1;
+			WFIFOW(fd, 2) = 13 + len;
+			WFIFOL(fd, 4) = 0;
+			WFIFOL(fd, 8) = color;
+			safestrncpy((char*)WFIFOP(fd, 12), mes, len + 1);
+			WFIFOSET(fd, WFIFOW(fd, 2));
+		}
 #else
 		char *message, *line;