From 21f56d4e9a19dc662152b6b355c39227a726a036 Mon Sep 17 00:00:00 2001 From: Ukendio Date: Tue, 7 May 2024 21:30:13 +0200 Subject: [PATCH] Move root archetype --- lib/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/init.lua b/lib/init.lua index 8c0b5bd..ce0951e 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -190,6 +190,7 @@ function World.new() nextEntityId = 0; ROOT_ARCHETYPE = (nil :: any) :: Archetype; }, World) + self.ROOT_ARCHETYPE = archetypeOf(self, {}, nil) return self end @@ -272,6 +273,7 @@ local function ensureEdge(archetype: Archetype, componentId: i53) end local function archetypeTraverseAdd(world: World, componentId: i53, from: Archetype): Archetype + from = from or world.ROOT_ARCHETYPE if not from then -- If there was no source archetype then it should return the ROOT_ARCHETYPE local ROOT_ARCHETYPE = world.ROOT_ARCHETYPE