SanderMertens / flecs

A fast entity component system (ECS) for C & C++
https://www.flecs.dev
Other
6.45k stars 453 forks source link

observers do not handle OnSet of components on an instance of a prefab that are added with .mut(world) #645

Closed Lost-Boy-Jason closed 2 years ago

Lost-Boy-Jason commented 2 years ago

Describe the bug Observers will not handle observing OnSet on instances of components that are set on the prefab of an instance by calling .mut(world) on the prefab and setting the instance.

To Reproduce Steps to reproduce the behavior:

  1. make a prefab that has one component set when initialized
  2. modify the prefab by setting another component by calling .mut(world).set
  3. make two observers for instances of the prefab, one for each component
  4. instance the prefab
  5. the OnSet observer for the first component will trigger, the OnSet observer for the second component will not.

Expected behavior the OnSet observer for each component will trigger, as both components are set on instancing

Additional context repro in text file OnSetBug.txt

SanderMertens commented 2 years ago

Fixed!