From 864da15c22446f589684c931afceebc276305d5a Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Mon, 21 Feb 2011 00:10:38 +0000
Subject: [PATCH] fix

git-svn-id: http://svn.net-core.org/repos/t-engine4@2776 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/engines/default/engine/UserChat.lua | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/game/engines/default/engine/UserChat.lua b/game/engines/default/engine/UserChat.lua
index 7c1190a20c..991ce332e8 100644
--- a/game/engines/default/engine/UserChat.lua
+++ b/game/engines/default/engine/UserChat.lua
@@ -44,11 +44,13 @@ end
 
 function _M:event(e)
 	if e.se == "Talk" then
+		e.msg = e.msg:removeColorCodes()
+
 		self.channels[e.channel] = self.channels[e.channel] or {users={}, log={}}
 		local log = self.channels[e.channel].log
 		table.insert(log, 1, ("<%s> %s"):format(e.user, e.msg))
 		while #log > 50 do table.remove(log) end
-		game.log("#YELLOW#"..log[1])
+		_G.game.log("#YELLOW#"..log[1])
 	elseif e.se == "Join" then
 		self.channels[e.channel] = self.channels[e.channel] or {users={}, log={}}
 		self.channels[e.channel].users[e.user] = true
@@ -60,6 +62,7 @@ end
 
 function _M:talk(msg)
 	if not msg then return end
+	msg = msg:removeColorCodes()
 	core.profile.pushOrder(string.format("o='ChatTalk' channel=%q msg=%q", self.cur_channel, msg))
 end
 
-- 
GitLab