Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ecs_lookup fails after entity name was set to NULL #795

Closed
sro5h opened this issue Aug 28, 2022 · 1 comment
Closed

ecs_lookup fails after entity name was set to NULL #795

sro5h opened this issue Aug 28, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@sro5h
Copy link
Contributor

sro5h commented Aug 28, 2022

Describe the bug
After changing the name of an entity to NULL and then back to the original name ecs_lookup can't find the entity anymore.

To Reproduce
Run the following example code:

#include "flecs/flecs.h"
#include <stdio.h>

int main(void) {
        ecs_world_t* w = ecs_init();

        ecs_entity_t e = ecs_new_id(w);
        ecs_set_name(w, e, "bob");

        if (ecs_lookup(w, "bob")) {
                printf("found entity 'bob'\n");
        }

        ecs_set_name(w, e, NULL);
        ecs_set_name(w, e, "bob");

        if (ecs_lookup(w, "bob")) {
                printf("found entity 'bob'\n");
        }

        return ecs_fini(w);
}

Expected behavior
Should print 'found entity 'bob'' twice.

Additional context
I'm on Fedora 36 compiling with gcc 12.2.1.

@sro5h sro5h added the bug Something isn't working label Aug 28, 2022
@SanderMertens
Copy link
Owner

Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants