Add menu scopes to state before closing them

This commit is contained in:
Jan
2021-11-06 17:47:18 +01:00
parent bf19208351
commit 5af2e6da61
8 changed files with 50 additions and 18 deletions

View File

@ -29,8 +29,7 @@ namespace menu::function_scope_sequences
const auto existingFunction = state->m_functions_by_name.find(state->m_current_function->m_name);
if (existingFunction == state->m_functions_by_name.end())
{
state->m_functions_by_name.emplace(std::make_pair(state->m_current_function->m_name, state->m_current_function.get()));
state->m_functions.emplace_back(std::move(state->m_current_function));
state->m_functions_by_name.emplace(std::make_pair(state->m_current_function->m_name, state->m_current_function));
state->m_current_function = nullptr;
}
else