fix component remove also removing priority
parent
e5c1d7e4c4
commit
52d4adf880
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue