fix: Bugs + temp push for bugfixing

This commit is contained in:
Mark Marks 2024-09-22 00:05:15 +02:00
parent 88ca58df9b
commit d34edf8d70
21 changed files with 2317 additions and 73 deletions

View file

@ -1,7 +1,7 @@
--!strict
--!optimize 2
local handle = require("./handle")
local world = require("./world").get()
local WORLD = require("./world").get
local refs = {}
@ -11,8 +11,9 @@ local refs = {}
--- @param key any
--- @return handle
local function ref(key: any): handle.handle
local world = WORLD()
if not key then
return handle.new(world:entity())
return handle(world:entity())
end
local entity = refs[key]
@ -21,7 +22,7 @@ local function ref(key: any): handle.handle
refs[key] = entity
end
return handle.new(entity)
return handle(entity)
end
return ref