Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(input/five): GameInput rebinding shouldn't remove all multimap en…
  • Loading branch information
blattersturm committed Feb 22, 2021
1 parent afc22f1 commit 7523088
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions code/components/gta-core-five/src/GameInput.cpp
Expand Up @@ -630,16 +630,16 @@ void BindingManager::Initialize()

std::shared_ptr<Binding> BindingManager::Bind(int ioSource, int ioParameter, const std::string& commandString)
{
for (auto& binding : m_bindings)
for (auto it = m_bindings.begin(); it != m_bindings.end(); )
{
if (binding.second->GetCommand() == commandString && IsTagActive(binding.second->GetTag()))
if (it->second->GetCommand() == commandString && IsTagActive(it->second->GetTag()))
{
m_bindings.erase(binding.first);
break;
it = m_bindings.erase(it);
continue;
}
}

//m_bindings.erase({ ioSource, ioParameter });
it++;
}

auto binding = std::make_shared<Binding>(commandString);
binding->SetBinding({ ioSource, ioParameter });
Expand Down

0 comments on commit 7523088

Please sign in to comment.