From 3719cdaee0f28a610ef59078f775b3c7f3951cb8 Mon Sep 17 00:00:00 2001 From: Mergul Date: Thu, 28 May 2020 09:39:17 +0200 Subject: [PATCH] Some small fixes --- source/bubel/ecs/id_manager.d | 1 + source/bubel/ecs/manager.d | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/bubel/ecs/id_manager.d b/source/bubel/ecs/id_manager.d index 084a947..aaeef30 100644 --- a/source/bubel/ecs/id_manager.d +++ b/source/bubel/ecs/id_manager.d @@ -56,6 +56,7 @@ struct IDManager */ void releaseID(EntityID id) nothrow @nogc { + optimize(); Data* data = &m_ids_array[id.id]; if (data.counter != id.counter) return; diff --git a/source/bubel/ecs/manager.d b/source/bubel/ecs/manager.d index cf3712d..a8954e0 100644 --- a/source/bubel/ecs/manager.d +++ b/source/bubel/ecs/manager.d @@ -2923,6 +2923,7 @@ export struct EntityManager private void updateBlock(EntitiesBlock* block) @nogc nothrow { + if(block.added_count == 0)return; EntityInfo* info = block.type_info; ushort entities_count = block.entities_count; block.entities_count += block.added_count; @@ -3056,7 +3057,7 @@ export struct EntityManager has_work = false; has_work |= updateEvents(); - id_manager.optimize(); + //id_manager.optimize(); has_work |= updateBlocks(); has_work |= changeEntities(); has_work |= removeEntities();