check entity in store before remove component
parent
5299d6ddad
commit
570b6832ad
|
@ -51,9 +51,12 @@ namespace Encompass
|
|||
}
|
||||
|
||||
public void RemoveComponent<TComponent>(Entity entity) where TComponent : struct, IComponent
|
||||
{
|
||||
if (entities.ContainsKey(entity))
|
||||
{
|
||||
entities[entity].Set(TypeToIndex[typeof(TComponent)], false);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveEntity(Entity entity)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue