You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/jecs.luau
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2976,6 +2976,10 @@ local function world_new(DEBUG: boolean?)
2976
2976
-- If there was a previous archetype, then the entity needs to move the archetype
2977
2977
inner_entity_move(entity, record, to)
2978
2978
else
2979
+
-- An entity moved back to root keeps a real slot in root.entities; remove it before the append, else a later delete of any root entity stomps this record's row.
2980
+
ifrecord.row~=0then
2981
+
archetype_delete(world, src, record.row)
2982
+
end
2979
2983
new_entity(entity, record, to)
2980
2984
end
2981
2985
@@ -3074,6 +3078,10 @@ local function world_new(DEBUG: boolean?)
3074
3078
ifnotsrc_is_root_archetypethen
3075
3079
inner_entity_move(entity, record, to)
3076
3080
else
3081
+
-- An entity moved back to root keeps a real slot in root.entities; remove it before the append, else a later delete of any root entity stomps this record's row.
0 commit comments