-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
Given the follow very simple example, using Friflo.Engine.ECS 3.4.2
using Friflo.Engine.ECS;
var store = new EntityStore();
var entity1 = store.CreateEntity(new Position());
CommandBuffer cb = store.GetCommandBuffer();
cb.RemoveComponent<Position>(entity1.Id);
cb.DeleteEntity(entity1.Id);
cb.Playback();
Will result in this exception:
Assemblies loaded: 73, duration: 48 ms, engine-dependants: [Friflo.Engine.ECS (9), ConsoleApp1 (0)]
Unhandled exception. System.InvalidOperationException: Playback - entity not found. command: entity: 1 - Remove [Position]
at Friflo.Engine.ECS.ComponentCommands`1.UpdateComponentTypes(Playback playback, Boolean storeOldComponent)
at Friflo.Engine.ECS.CommandBuffer.PrepareComponentCommands(Playback playback)
at Friflo.Engine.ECS.CommandBuffer.Playback()
at Program.<Main>$(String[] args) in [Redacted]\ConsoleApp1\ConsoleApp1\Program.cs:line 9
It also happens when you have multiple other components or just add a component, it seems deleting an entity in the same command buffer playback as modifiying its components per Add/RemoveComponent causes this exception.
Magnatales
Metadata
Metadata
Assignees
Labels
No labels