Browse Source

fix component remove also removing priority

refactor
cosmonaut 2 years ago
parent
commit
52d4adf880
  1. 3
      encompass-cs/Collections/TypedComponentStore.cs

3
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)

Loading…
Cancel
Save