mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2025-04-19 09:42:59 +02:00
fix overwriting tasks
This commit is contained in:
parent
0027d612b0
commit
9b53c72826
@ -5,6 +5,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
#include <mm/logger.hpp>
|
||||||
#include <tracy/Tracy.hpp>
|
#include <tracy/Tracy.hpp>
|
||||||
|
|
||||||
namespace MM::UpdateStrategies {
|
namespace MM::UpdateStrategies {
|
||||||
@ -34,6 +35,20 @@ bool Sequential::enableService(const entt::id_type service_id, std::vector<TaskI
|
|||||||
auto& service = _service_tasks[service_id];
|
auto& service = _service_tasks[service_id];
|
||||||
|
|
||||||
for (const auto& task : task_array) {
|
for (const auto& task : task_array) {
|
||||||
|
if (_tasks.count(task._key)) {
|
||||||
|
entt::id_type other_service = 0;
|
||||||
|
for (const auto& it : _service_tasks) {
|
||||||
|
if (it.second.count(task._key)) {
|
||||||
|
other_service = it.first;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: this is cryptic
|
||||||
|
SPDLOG_ERROR("service '{}' adding task with taken id '{}'/'{}'. taken by '{}'", service_id, task._key, task._name, other_service);
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
_tasks.emplace(task._key, task);
|
_tasks.emplace(task._key, task);
|
||||||
service.emplace(task._key);
|
service.emplace(task._key);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user