Skip to content

Wrong IndexedComponent replacement when using CommandBuffer #99

@WWQ1993

Description

@WWQ1993

Hello, when using ComponentIndex in the system, I found that during a loop iteration, it's unable to overwrite the original ComponentIndex value.

[Test]
    public static void Test_IndexedComponent_CommandBuffer()
    {
        var store   = new EntityStore();
        var index   = store.ComponentIndex<IndexedInt, int>();
        store.CreateEntity(1);
        
        
        var ecb = store.GetCommandBuffer();
        ecb.ReuseBuffer = true;
        ecb.AddComponent(1, new IndexedInt { value = 70 });
        ecb.AddComponent(1, new IndexedInt { value = 71 });   // replace previous value
        ecb.Playback();
        
 
        AreEqual(1, index.Values.Count); // should be 1, in fact is 2 
    }
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions