about summary refs log tree commit diff
path: root/src/engine/client
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-08-07 20:22:25 +0200
committeroy <Tom_Adams@web.de>2010-08-07 20:22:25 +0200
commitad9b32b7417d0837c485b6c9b802cc90aa51c521 (patch)
treefb2c0cd8d68f58bbbd1e0d895cb82086ea824fe7 /src/engine/client
parent3f0ff1fb1404efcb312a6bfcef0beb4b6a0d92ef (diff)
downloadzcatch-ad9b32b7417d0837c485b6c9b802cc90aa51c521.tar.gz
zcatch-ad9b32b7417d0837c485b6c9b802cc90aa51c521.zip
added the possibility to store commands within the console and execute them later on when everything is initialised correctly - fixes several possible startup crashes and the "Support bans in server configuration"-ticket
Diffstat (limited to 'src/engine/client')
-rw-r--r--src/engine/client/client.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp
index 90bb70d3..4ab8ee60 100644
--- a/src/engine/client/client.cpp
+++ b/src/engine/client/client.cpp
@@ -1613,6 +1613,9 @@ void CClient::Run()
 
 	Input()->MouseModeRelative();
 
+	// process pending commands
+	m_pConsole->StoreCommands(false);
+
 	while (1)
 	{
 		int64 FrameStartTime = time_get();
@@ -1915,7 +1918,7 @@ void CClient::RegisterCommands()
 
 	m_pConsole->Register("quit", "", CFGFLAG_CLIENT, Con_Quit, this, "Quit Teeworlds");
 	m_pConsole->Register("exit", "", CFGFLAG_CLIENT, Con_Quit, this, "Quit Teeworlds");
-	m_pConsole->Register("minimize", "", CFGFLAG_CLIENT, Con_Minimize, this, "Minimize Teeworlds");
+	m_pConsole->Register("minimize", "", CFGFLAG_CLIENT|CFGFLAG_STORE, Con_Minimize, this, "Minimize Teeworlds");
 	m_pConsole->Register("connect", "s", CFGFLAG_CLIENT, Con_Connect, this, "Connect to the specified host/ip");
 	m_pConsole->Register("disconnect", "", CFGFLAG_CLIENT, Con_Disconnect, this, "Disconnect from the server");
 	m_pConsole->Register("ping", "", CFGFLAG_CLIENT, Con_Ping, this, "Ping the current server");