Skip to content

Commit 9068737

Browse files
Fix #2183: Tweak bind queue logic (#2199)
* Execute script created binds same frame * Execute up to 2 binds same frame
1 parent 8eeac9a commit 9068737

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Client/core/CKeyBinds.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ bool CKeyBinds::ProcessKeyStroke(const SBindableKey* pKey, bool bState)
483483
// don't add if its already added to queue
484484
if (!bAlreadyProcessed)
485485
{
486-
if (processedList.empty())
486+
if (pCommandBind->bScriptCreated || processedList.empty())
487487
Call(pCommandBind);
488488
else
489489
m_vecBindQueue.push_back(pCommandBind);
@@ -2094,9 +2094,12 @@ void CKeyBinds::DoPreFramePulse()
20942094
m_pChatBoxBind = NULL;
20952095
}
20962096

2097-
if (!m_vecBindQueue.empty())
2097+
// Execute two binds from queue
2098+
for (auto i = 0; i < 2; i++)
20982099
{
20992100
auto it = m_vecBindQueue.begin();
2101+
if (it == m_vecBindQueue.end())
2102+
break;
21002103
Call(*it);
21012104
m_vecBindQueue.erase(it);
21022105
}

0 commit comments

Comments
 (0)