mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 01:41:10 +00:00
[scene] Improve entity component check
For a component to be on an entity, the entity id in the component pool's dense array must match the entity.
This commit is contained in:
parent
52b7f7f308
commit
4df145d76a
1 changed files with 1 additions and 1 deletions
|
@ -194,7 +194,7 @@ COMPINLINE int
|
|||
Ent_HasComponent (uint32_t ent, uint32_t comp, ecs_registry_t *reg)
|
||||
{
|
||||
uint32_t ind = reg->comp_pools[comp].sparse[Ent_Index (ent)];
|
||||
return ind != nullent;
|
||||
return reg->comp_pools[comp].dense[ind] == ent;
|
||||
}
|
||||
|
||||
COMPINLINE void *
|
||||
|
|
Loading…
Reference in a new issue