Fix event_handler

This commit is contained in:
Federico Cecchetto 2022-03-13 23:11:49 +01:00
parent 2a5e9721c3
commit 97acea9e71
2 changed files with 3 additions and 3 deletions

View File

@ -81,9 +81,9 @@ namespace scripting::lua
{ {
auto merger = [&](task_list& tasks) auto merger = [&](task_list& tasks)
{ {
for(auto& task : tasks) for (auto& task : tasks)
{ {
if(task.id == handle.id) if (task.id == handle.id)
{ {
task.endon_conditions.emplace_back(entity, event); task.endon_conditions.emplace_back(entity, event);
} }

View File

@ -43,7 +43,7 @@ namespace scripting::lua
sol::state& state_; sol::state& state_;
std::atomic_int64_t current_listener_id_ = 0; std::atomic_int64_t current_listener_id_ = 0;
using task_list = std::vector<event_listener>; using task_list = std::list<event_listener>;
utils::concurrency::container<task_list> new_callbacks_; utils::concurrency::container<task_list> new_callbacks_;
utils::concurrency::container<task_list, std::recursive_mutex> callbacks_; utils::concurrency::container<task_list, std::recursive_mutex> callbacks_;