From b09bcb90a35ec2ea99023da0f9e8d465925aec31 Mon Sep 17 00:00:00 2001 From: Marcel Herd Date: Sat, 28 Jan 2017 17:02:39 +0100 Subject: [PATCH] Added check for unbound key --- src/game/client/components/binds.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/game/client/components/binds.cpp b/src/game/client/components/binds.cpp index 4abce0966..675356a43 100644 --- a/src/game/client/components/binds.cpp +++ b/src/game/client/components/binds.cpp @@ -194,7 +194,15 @@ void CBinds::ConBindPrint(IConsole::IResult *pResult, void *pUserData) } else { char aBuf[256]; - str_format(aBuf, sizeof(aBuf), "bind %s (%d) = %s", pKeyName, id, pBinds->m_aaKeyBindings[id]); + + if (pBinds->m_aaKeyBindings[id][0] == '\0') + { + str_format(aBuf, sizeof(aBuf), "%s (%d) is not bound", pKeyName, id); + } + else { + str_format(aBuf, sizeof(aBuf), "%s (%d) = %s", pKeyName, id, pBinds->m_aaKeyBindings[id]); + } + pBinds->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "binds", aBuf); } }