From c97e354bc14580b53e2ad0bcf95b741c91a34cd8 Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Sun, 13 Mar 2022 23:11:49 +0100 Subject: [PATCH] Fix event_handler --- src/client/game/scripting/lua/event_handler.cpp | 4 ++-- src/client/game/scripting/lua/event_handler.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/game/scripting/lua/event_handler.cpp b/src/client/game/scripting/lua/event_handler.cpp index 7121ea63..ef8597ce 100644 --- a/src/client/game/scripting/lua/event_handler.cpp +++ b/src/client/game/scripting/lua/event_handler.cpp @@ -81,9 +81,9 @@ namespace scripting::lua { 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); } diff --git a/src/client/game/scripting/lua/event_handler.hpp b/src/client/game/scripting/lua/event_handler.hpp index fc95b704..e12dcab6 100644 --- a/src/client/game/scripting/lua/event_handler.hpp +++ b/src/client/game/scripting/lua/event_handler.hpp @@ -43,7 +43,7 @@ namespace scripting::lua sol::state& state_; std::atomic_int64_t current_listener_id_ = 0; - using task_list = std::vector; + using task_list = std::list; utils::concurrency::container new_callbacks_; utils::concurrency::container callbacks_;