mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 09:30:03 +00:00
Should be componentId not entityId
This commit is contained in:
parent
fad2a21ac5
commit
75518fcdce
1 changed files with 2 additions and 2 deletions
|
@ -293,7 +293,7 @@ end
|
||||||
function World.add(world: World, entityId: i53, componentId: i53)
|
function World.add(world: World, entityId: i53, componentId: i53)
|
||||||
local record = ensureRecord(world.entityIndex, entityId)
|
local record = ensureRecord(world.entityIndex, entityId)
|
||||||
local from = record.archetype
|
local from = record.archetype
|
||||||
local to = archetypeTraverseAdd(world, entityId, from)
|
local to = archetypeTraverseAdd(world, componentId, from)
|
||||||
if from then
|
if from then
|
||||||
moveEntity(world.entityIndex, entityId, record, to)
|
moveEntity(world.entityIndex, entityId, record, to)
|
||||||
else
|
else
|
||||||
|
@ -308,7 +308,7 @@ end
|
||||||
function World.set(world: World, entityId: i53, componentId: i53, data: unknown)
|
function World.set(world: World, entityId: i53, componentId: i53, data: unknown)
|
||||||
local record = ensureRecord(world.entityIndex, entityId)
|
local record = ensureRecord(world.entityIndex, entityId)
|
||||||
local from = record.archetype
|
local from = record.archetype
|
||||||
local to = archetypeTraverseAdd(world, entityId, from)
|
local to = archetypeTraverseAdd(world, componentId, from)
|
||||||
|
|
||||||
if from == to then
|
if from == to then
|
||||||
-- If the archetypes are the same it can avoid moving the entity
|
-- If the archetypes are the same it can avoid moving the entity
|
||||||
|
|
Loading…
Reference in a new issue