[ecs] Invalidate entity before removing components

It turns out that the fixes for other problems related to removing
hierarchy reference components fixed the problem moving the entity
invalidation fixed, and invalidating the entity late somehow broke the
sprite renderer (at least in glsl).
This commit is contained in:
Bill Currie 2023-03-05 23:31:20 +09:00
parent 9982eb629d
commit e19e7cad0c

View file

@ -209,13 +209,13 @@ ECS_DelEntity (ecs_registry_t *registry, uint32_t ent)
}
uint32_t next = registry->next | Ent_NextGen (Ent_Generation (ent));
uint32_t id = Ent_Index (ent);
registry->entities[id] = next;
registry->next = id;
registry->available++;
for (uint32_t i = 0; i < registry->components.size; i++) {
Ent_RemoveComponent (ent, i, registry);
}
registry->entities[id] = next;
registry->next = id;
registry->available++;
}
VISIBLE void