From 1c2903b0b4497e04b531a46da1bb738ce65a4c0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Wed, 29 Nov 2023 20:39:54 +0100 Subject: [PATCH 1/2] Remove unused enum literal `MAX_PRINT_CB` --- src/engine/console.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/engine/console.h b/src/engine/console.h index 464c16348..ecbd80660 100644 --- a/src/engine/console.h +++ b/src/engine/console.h @@ -34,8 +34,6 @@ public: TEMPCMD_HELP_LENGTH = 192, TEMPCMD_PARAMS_LENGTH = 96, - MAX_PRINT_CB = 4, - CLIENT_ID_GAME = -2, CLIENT_ID_NO_GAME = -3, }; From a1eb0ddd4ce6d1c059ca65fc7f352cf37cf9f813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Wed, 29 Nov 2023 20:39:25 +0100 Subject: [PATCH 2/2] Also print command in console when identical to previous The command currently being executed was not being printed to the console if it's identical to the previous history entry. --- src/game/client/components/console.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/client/components/console.cpp b/src/game/client/components/console.cpp index 3e067ed30..f6458dc53 100644 --- a/src/game/client/components/console.cpp +++ b/src/game/client/components/console.cpp @@ -254,11 +254,11 @@ bool CGameConsole::CInstance::OnInput(const IInput::CEvent &Event) { char *pEntry = m_History.Allocate(m_Input.GetLength() + 1); str_copy(pEntry, m_Input.GetString(), m_Input.GetLength() + 1); - // print out the user's commands before they get run - char aBuf[256]; - str_format(aBuf, sizeof(aBuf), "> %s", m_Input.GetString()); - m_pGameConsole->PrintLine(m_Type, aBuf); } + // print out the user's commands before they get run + char aBuf[256]; + str_format(aBuf, sizeof(aBuf), "> %s", m_Input.GetString()); + m_pGameConsole->PrintLine(m_Type, aBuf); } ExecuteLine(m_Input.GetString()); m_Input.Clear();