Added check for unbound key

This commit is contained in:
Marcel Herd 2017-01-28 17:02:39 +01:00
parent 1f58595033
commit b09bcb90a3

View file

@ -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);
}
}