diff --git a/libs/util/include/psemek/util/ecs.hpp b/libs/util/include/psemek/util/ecs.hpp index d645c291..43908af0 100644 --- a/libs/util/include/psemek/util/ecs.hpp +++ b/libs/util/include/psemek/util/ecs.hpp @@ -131,7 +131,7 @@ namespace psemek::util else { // packed - for (std::size_t i = 0; i < entity_count(); ++i) + for (std::size_t i = 0; i < entity_count();) { ctx.entity = i; ctx.remove = false; @@ -139,7 +139,10 @@ namespace psemek::util if (ctx.remove) remove_entity(i); else + { std::apply(increment, cptrs); + ++i; + } } } }