about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/client/components/menus_demo.cpp2
-rw-r--r--src/game/client/gameclient.cpp18
-rw-r--r--src/game/client/gameclient.hpp2
3 files changed, 19 insertions, 3 deletions
diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp
index a8ed0177..08db3162 100644
--- a/src/game/client/components/menus_demo.cpp
+++ b/src/game/client/components/menus_demo.cpp
@@ -91,7 +91,9 @@ void MENUS::render_demoplayer(RECT main_view)
 				if(amount > 0 && amount < 1.0f)
 				{
 					gameclient.on_reset();
+					gameclient.suppress_events = true;
 					client_demoplayer_setpos(amount);
+					gameclient.suppress_events = false;
 				}
 			}
 		}
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();
 		}
diff --git a/src/game/client/gameclient.hpp b/src/game/client/gameclient.hpp
index d4c8510a..e470dc09 100644
--- a/src/game/client/gameclient.hpp
+++ b/src/game/client/gameclient.hpp
@@ -23,6 +23,7 @@ class GAMECLIENT
 	STACK all;
 	STACK input;
 	
+	
 	void dispatch_input();
 	void process_events();
 	void update_local_character_pos();
@@ -34,6 +35,7 @@ class GAMECLIENT
 	static void con_kill(void *result, void *user_data);
 	
 public:
+	bool suppress_events;
 
 	// TODO: move this
 	TUNING_PARAMS tuning;