From 52d4adf8805b8b87adaa383274f6835cca5621e5 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Fri, 12 Mar 2021 00:20:43 -0800 Subject: [PATCH] fix component remove also removing priority --- encompass-cs/Collections/TypedComponentStore.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/encompass-cs/Collections/TypedComponentStore.cs b/encompass-cs/Collections/TypedComponentStore.cs index 5b837c6..fd7bb49 100644 --- a/encompass-cs/Collections/TypedComponentStore.cs +++ b/encompass-cs/Collections/TypedComponentStore.cs @@ -78,8 +78,8 @@ namespace Encompass { if (!_priorities.ContainsKey(entityID) || priority <= _priorities[entityID]) // if priorities are equal that means it's the same engine { - _priorities[entityID] = priority; ForceRemove(entityID); + _priorities[entityID] = priority; return true; } @@ -92,7 +92,6 @@ namespace Encompass { var storageIndex = _entityIDToStorageIndex[entityID]; _entityIDToStorageIndex.Remove(entityID); - _priorities.Remove(entityID); // move a component into the hole to maintain contiguous memory if (_nextID > 1 && storageIndex != _nextID - 1)