Closed xentripetal closed 3 months ago
Looks like this is a bug in flecs as it is also reproducible in C and C++ on the v4 branch. This should be reported on the flecs repo.
#include "flecs.h"
typedef struct {
int x, y;
} Position;
void OnPosition(ecs_iter_t* it) {
printf("Called\n");
}
int main(void) {
ecs_world_t* world = ecs_init();
ECS_COMPONENT(world, Position);
ECS_OBSERVER(world, OnPosition, EcsOnAdd, Position); // Change to EcsWildcard and it doesn't print anything.
ecs_entity_t e = ecs_new(world);
ecs_add(world, e, Position);
}
This is bug was fixed in the latest NuGet package.
The current v4 branch (060afe73ba8d4180a32149663b256e43b1fd46d4) does not seem to support wildcard events on observers. The below test suite passes for
TestSpecificObserverBehavior
and fails onTestWildcardObserverBehavior
.The v4 flecs docs says this should be supported https://github.com/SanderMertens/flecs/blob/v4/docs/ObserversManual.md#multi-event-observers