about summary refs log tree commit diff
path: root/src/game/client/components/chat.cpp
diff options
context:
space:
mode:
authorTeetime <TeetimeTW@yahoo.de>2013-03-24 04:19:57 +0100
committerTeetime <TeetimeTW@yahoo.de>2013-03-24 04:19:57 +0100
commit4affc155a906b6091aafc3f9635acc3b8b0aed8a (patch)
tree43e4dc20b9c36599571f3caf2e9108a4bb3f5401 /src/game/client/components/chat.cpp
parent6e73cd75bf24eb98781c68ae47d6527cc03262c8 (diff)
parent0914490bd994185caef6bfc3038f5cec737e31f3 (diff)
downloadzcatch-4affc155a906b6091aafc3f9635acc3b8b0aed8a.tar.gz
zcatch-4affc155a906b6091aafc3f9635acc3b8b0aed8a.zip
Merge branch 'master0.6' into zCatch
Conflicts:
	data/languages/index.txt
	src/game/server/entities/character.cpp
Diffstat (limited to 'src/game/client/components/chat.cpp')
-rw-r--r--src/game/client/components/chat.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp
index 340b9da1..f3370f94 100644
--- a/src/game/client/components/chat.cpp
+++ b/src/game/client/components/chat.cpp
@@ -112,13 +112,25 @@ bool CChat::OnInput(IInput::CEvent Event)
 	{
 		if(m_Input.GetString()[0])
 		{
+			bool AddEntry = false;
+
 			if(m_LastChatSend+time_freq() < time_get())
+			{
 				Say(m_Mode == MODE_ALL ? 0 : 1, m_Input.GetString());
-			else
+				AddEntry = true;
+			}
+			else if(m_PendingChatCounter < 3)
+			{
 				++m_PendingChatCounter;
-			CHistoryEntry *pEntry = m_History.Allocate(sizeof(CHistoryEntry)+m_Input.GetLength());
-			pEntry->m_Team = m_Mode == MODE_ALL ? 0 : 1;
-			mem_copy(pEntry->m_aText, m_Input.GetString(), m_Input.GetLength()+1);
+				AddEntry = true;
+			}
+
+			if(AddEntry)
+			{
+				CHistoryEntry *pEntry = m_History.Allocate(sizeof(CHistoryEntry)+m_Input.GetLength());
+				pEntry->m_Team = m_Mode == MODE_ALL ? 0 : 1;
+				mem_copy(pEntry->m_aText, m_Input.GetString(), m_Input.GetLength()+1);
+			}
 		}
 		m_pHistoryEntry = 0x0;
 		m_Mode = MODE_NONE;
@@ -265,9 +277,9 @@ void CChat::OnMessage(int MsgType, void *pRawMsg)
 
 void CChat::AddLine(int ClientID, int Team, const char *pLine)
 {
-	if(ClientID != -1 && (m_pClient->m_aClients[ClientID].m_aName[0] == '\0' || // unknown client
+	if(*pLine == 0 || (ClientID != -1 && (m_pClient->m_aClients[ClientID].m_aName[0] == '\0' || // unknown client
 		m_pClient->m_aClients[ClientID].m_ChatIgnore ||
-		(m_pClient->m_Snap.m_LocalClientID != ClientID && g_Config.m_ClShowChatFriends && !m_pClient->m_aClients[ClientID].m_Friend)))
+		(m_pClient->m_Snap.m_LocalClientID != ClientID && g_Config.m_ClShowChatFriends && !m_pClient->m_aClients[ClientID].m_Friend))))
 		return;
 
 	bool Highlighted = false;