fix component remove also removing priority
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

refactor
cosmonaut 2021-03-12 00:20:43 -08:00
parent e5c1d7e4c4
commit 52d4adf880
1 changed files with 1 additions and 2 deletions

View File

@ -78,8 +78,8 @@ namespace Encompass
{ {
if (!_priorities.ContainsKey(entityID) || priority <= _priorities[entityID]) // if priorities are equal that means it's the same engine if (!_priorities.ContainsKey(entityID) || priority <= _priorities[entityID]) // if priorities are equal that means it's the same engine
{ {
_priorities[entityID] = priority;
ForceRemove(entityID); ForceRemove(entityID);
_priorities[entityID] = priority;
return true; return true;
} }
@ -92,7 +92,6 @@ namespace Encompass
{ {
var storageIndex = _entityIDToStorageIndex[entityID]; var storageIndex = _entityIDToStorageIndex[entityID];
_entityIDToStorageIndex.Remove(entityID); _entityIDToStorageIndex.Remove(entityID);
_priorities.Remove(entityID);
// move a component into the hole to maintain contiguous memory // move a component into the hole to maintain contiguous memory
if (_nextID > 1 && storageIndex != _nextID - 1) if (_nextID > 1 && storageIndex != _nextID - 1)