From ad9b32b7417d0837c485b6c9b802cc90aa51c521 Mon Sep 17 00:00:00 2001 From: oy Date: Sat, 7 Aug 2010 20:22:25 +0200 Subject: 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 --- src/engine/client/client.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/engine/client/client.cpp') 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"); -- cgit 1.4.1