[ECS] WorldEnumerator now skips deleted entities

This commit is contained in:
Simon Lübeß
2021-09-14 23:29:33 +02:00
parent db05a5a6a9
commit ab17598972
@@ -42,6 +42,11 @@ namespace GlitchyEngine.World
while(_currentEntry < _endEntry)
{
EcsWorld.BitmaskEntry* entry = _currentEntry++;
// Skip deleted entities
if(entry.ID.Index == Entity.InvalidEntity.Index)
continue;
// Check whether or not mask matches
if(entry.ComponentMask.MaskMatch(_bitMask))
return entry.ID;