From 830352fd70cf488070cd88bd5d3d3854a10ed9bc Mon Sep 17 00:00:00 2001 From: def Date: Sat, 3 Oct 2020 09:57:20 +0200 Subject: [PATCH] Revert "Fix ctrl+shift+d moving tee (fixes #2930)" This reverts commit 9b0081de57fe1fcca9955e8881441e46256470de. --- src/game/client/components/binds.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/game/client/components/binds.cpp b/src/game/client/components/binds.cpp index 8ae047ff5..cf3d0f28a 100644 --- a/src/game/client/components/binds.cpp +++ b/src/game/client/components/binds.cpp @@ -54,7 +54,7 @@ void CBinds::Bind(int KeyID, const char *pStr, bool FreeOnly, int Modifier) // skip modifiers for +xxx binds if(pStr[0] == '+') - Modifier = 1 << MODIFIER_NONE; + Modifier = 0; char aBuf[256]; if(!pStr[0]) @@ -130,6 +130,7 @@ bool CBinds::OnInput(IInput::CEvent e) if(!Mask) Mask = 1 << MODIFIER_NONE; + bool ret = false; for(int Mod = 1; Mod < MODIFIER_COMBINATION_COUNT; Mod++) { if(m_aapKeyBindings[Mod][e.m_Key] && (Mask == Mod)) @@ -138,11 +139,20 @@ bool CBinds::OnInput(IInput::CEvent e) Console()->ExecuteLineStroked(1, m_aapKeyBindings[Mod][e.m_Key]); if(e.m_Flags & IInput::FLAG_RELEASE) Console()->ExecuteLineStroked(0, m_aapKeyBindings[Mod][e.m_Key]); - return true; + ret = true; } } - return false; + if(m_aapKeyBindings[0][e.m_Key] && (!ret || m_aapKeyBindings[0][e.m_Key][0] == '+')) // always trigger +xxx binds despite any modifier + { + if(e.m_Flags & IInput::FLAG_PRESS) + Console()->ExecuteLineStroked(1, m_aapKeyBindings[0][e.m_Key]); + if(e.m_Flags & IInput::FLAG_RELEASE) + Console()->ExecuteLineStroked(0, m_aapKeyBindings[0][e.m_Key]); + ret = true; + } + + return ret; } void CBinds::UnbindAll()