about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-16 22:48:02 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-16 22:48:02 +0000
commit1c5103e891399fecbe68a72fada11b5dd5c10ce4 (patch)
tree502a0d87479eda5697ac7ef47c383d7b8414c7dc
parent4a3c2e2c8c3a8dee5828258f920f1c175e952cb0 (diff)
downloadzcatch-1c5103e891399fecbe68a72fada11b5dd5c10ce4.tar.gz
zcatch-1c5103e891399fecbe68a72fada11b5dd5c10ce4.zip
fixed the chatting
-rw-r--r--src/engine/e_if_inp.h2
-rw-r--r--src/game/client/gc_client.cpp21
2 files changed, 13 insertions, 10 deletions
diff --git a/src/engine/e_if_inp.h b/src/engine/e_if_inp.h
index 8e0ea2c2..00f44ba1 100644
--- a/src/engine/e_if_inp.h
+++ b/src/engine/e_if_inp.h
@@ -20,7 +20,7 @@ enum
 typedef struct
 {
 	int flags;
-	char ch;
+	unsigned char ch;
 	int key;
 } INPUT_EVENT;
 
diff --git a/src/game/client/gc_client.cpp b/src/game/client/gc_client.cpp
index 2526ab83..580eb302 100644
--- a/src/game/client/gc_client.cpp
+++ b/src/game/client/gc_client.cpp
@@ -718,13 +718,16 @@ void chat_say(int team, const char *line)
 
 void chat_enable_mode(int team)
 {
-	if(team)
-		chat_mode = CHATMODE_TEAM;
-	else
-		chat_mode = CHATMODE_ALL;
-		
-	mem_zero(chat_input, sizeof(chat_input));
-	chat_input_len = 0;
+	if(chat_mode == CHATMODE_NONE)
+	{
+		if(team)
+			chat_mode = CHATMODE_TEAM;
+		else
+			chat_mode = CHATMODE_ALL;
+			
+		mem_zero(chat_input, sizeof(chat_input));
+		chat_input_len = 0;
+	}
 }
 
 void render_game()
@@ -801,7 +804,7 @@ void render_game()
 			for(int i = 0; i < inp_num_events(); i++)
 			{
 				INPUT_EVENT e = inp_get_event(i);
-
+	
 				if (!(e.ch >= 0 && e.ch < 32))
 				{
 					if (chat_input_len < sizeof(chat_input) - 1)
@@ -812,7 +815,7 @@ void render_game()
 					}
 				}
 
-				if(e.key == KEY_BACKSPACE)
+				if(e.key == KEY_BACKSPACE && (e.flags&INPFLAG_PRESS))
 				{
 					if(chat_input_len > 0)
 					{