about summary refs log tree commit diff
path: root/src/game/client/gameclient.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-12-19 11:41:17 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-12-19 11:41:17 +0000
commite447ef04ccb5cde55c49a8d0dd62c87619048251 (patch)
treeef67e8f9b477108788069a0f1a9a2ff596f8439d /src/game/client/gameclient.cpp
parent5e3f7402206e269e013c050a5a0e98a579a0246e (diff)
downloadzcatch-e447ef04ccb5cde55c49a8d0dd62c87619048251.tar.gz
zcatch-e447ef04ccb5cde55c49a8d0dd62c87619048251.zip
fixed so that events isn't processed when scrubbing a demo
Diffstat (limited to 'src/game/client/gameclient.cpp')
-rw-r--r--src/game/client/gameclient.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp
index 11b26053..c21c4ff9 100644
--- a/src/game/client/gameclient.cpp
+++ b/src/game/client/gameclient.cpp
@@ -160,6 +160,9 @@ void GAMECLIENT::on_console_init()
 	// let all the other components register their console commands
 	for(int i = 0; i < all.num; i++)
 		all.components[i]->on_console_init();
+		
+	//
+	suppress_events = false;
 }
 
 void GAMECLIENT::on_init()
@@ -443,6 +446,9 @@ void GAMECLIENT::on_statechange(int new_state, int old_state)
 
 void GAMECLIENT::process_events()
 {
+	if(suppress_events)
+		return;
+	
 	int snaptype = SNAP_CURRENT;
 	int num = snap_num_items(snaptype);
 	for(int index = 0; index < num; index++)
@@ -514,11 +520,17 @@ void GAMECLIENT::on_snapshot()
 
 	if(config.dbg_stress)
 	{
-		if((client_tick()%250) == 0)
+		if((client_tick()%100) == 0)
 		{
+			char message[64];
+			int msglen = rand()%(sizeof(message)-1);
+			for(int i = 0; i < msglen; i++)
+				message[i] = 'a'+(rand()%('z'-'a'));
+			message[msglen] = 0;
+				
 			NETMSG_CL_SAY msg;
-			msg.team = -1;
-			msg.message = "galenskap!!!!";
+			msg.team = rand()&1;
+			msg.message = message;
 			msg.pack(MSGFLAG_VITAL);
 			client_send_msg();
 		}