From 19e113cde361df3dc04c68cee399da0779aa20de Mon Sep 17 00:00:00 2001 From: Jordy Ruiz Date: Thu, 1 Nov 2018 12:09:36 +0100 Subject: [PATCH] Fix -c argument being ignored if not in first position --- src/engine/client/client.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 0f716002b..83626ab45 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -2431,18 +2431,25 @@ void CClient::HandleTeeworldsConnectLink(const char *pConLink) int main(int argc, const char **argv) // ignore_convention { #if defined(CONF_FAMILY_WINDOWS) + bool UseDefaultConsoleSettings = true; for(int i = 1; i < argc; i++) // ignore_convention { #ifdef CONF_RELEASE - if(!(str_comp("-c", argv[i]) == 0 || str_comp("--console", argv[i]) == 0)) // ignore_convention + if(str_comp("-c", argv[i]) == 0 || str_comp("--console", argv[i]) == 0) // ignore_convention #else if(str_comp("-s", argv[i]) == 0 || str_comp("--silent", argv[i]) == 0) // ignore_convention #endif { - FreeConsole(); + UseDefaultConsoleSettings = false; break; } } +#ifdef CONF_RELEASE + if(!UseDefaultConsoleSettings) +#else + if(UseDefaultConsoleSettings) +#endif + FreeConsole(); #endif bool UseDefaultConfig = false;