SanderMertens / flecs

A fast entity component system (ECS) for C & C++

Home Page:https://www.flecs.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clone entity with name cause internal error

xubury opened this issue · comments

Describe the bug
Cloning a named entity cause fatal error. Is it because flecs do not allow entity with same name? Can I skip name value copy to avoid?
To Reproduce

    ecs.entity().clone();         // ok
    ecs.entity("potato").clone(); // fatal: name_index.c: 210: INTERNAL_ERROR
    ecs.entity("potato").clone(true, ecs.entity("tomato")); // fatal: name_index.c: 210: INTERNAL_ERROR

Expected behavior
Clone named entity without error.

This is a known issue of the clone function- no two entities with the same name can exist under the same parent entity. I'll take a look at this.