diff --git a/docs/changelog.md b/docs/changelog.md index 2e65e329..5bdf37de 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,10 +1,7 @@ -* * * - +--- hide: - - navigation - -* * * +--- # Changelog @@ -15,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fixes an error with controllers not loading + ## [9.0.0-rc10] - 2024-09-21 ### Fixed diff --git a/src/init.luau b/src/init.luau index 9fe5eb4a..bb2578de 100644 --- a/src/init.luau +++ b/src/init.luau @@ -35,43 +35,34 @@ end -- Starts/inits a list of controllers internally local function LoadAllControllers(controllers: { Types.Controller }) - local InitiatedControllers = {} + local InitiatedControllers = {} for _, controller in controllers do if controller["Uses"] and type(controller.Uses) == "table" then - table.freeze(controller.Uses) + table.freeze(controller.Uses) for _, usedController in controller.Uses :: any do - Debugger.Assert( - type(usedController["Init"]) == "function", - "IncorrectType", "Init", "function" - ) if usedController["Init"] then - LoadController(usedController.Init, "Init") - table.insert(InitiatedControllers, usedController) - table.remove(controllers, table.find(controllers, controller)) - end + Debugger.Assert(type(usedController["Init"]) == "function", "IncorrectType", "Init", "function") + LoadController(usedController.Init, "Init") + table.insert(InitiatedControllers, usedController) + table.remove(controllers, table.find(controllers, controller)) + end end end - Debugger.Assert( - type(controller["Init"]) == "function", - "IncorrectType", "Init", "function" - ) if controller["Init"] then + Debugger.Assert(type(controller["Init"]) == "function", "IncorrectType", "Init", "function") LoadController(controller.Init, "Init") - table.insert(InitiatedControllers, controller) + table.insert(InitiatedControllers, controller) end end - for _, controller in InitiatedControllers do - Debugger.Assert( - type(controller["Start"]) == "function", - "IncorrectType", "Start", "function" - ) - if controller["Start"] then + for _, controller in InitiatedControllers do + if controller["Start"] then + Debugger.Assert(type(controller["Start"]) == "function", "IncorrectType", "Start", "function") LoadController(controller.Start, "Start") end - end + end end -- Starts all the workers internally @@ -141,9 +132,9 @@ end local function Cycle(type: Types.CycleType, callback: (...any) -> ()) Debugger.Assert(not Started, "AlreadyStarted") Debugger.Assert(DefaultCycleTypes[type], "ItemNotFound", type) - if type == "PreRender" and not RunService:IsClient() then - Debugger.Fatal("IncorrectContext", "WorkerType") - end + if type == "PreRender" and not RunService:IsClient() then + Debugger.Fatal("IncorrectContext", "WorkerType") + end table.insert( Storage.Cycles, table.freeze({ diff --git a/tests/server/Modules/KillPart.luau b/tests/server/Modules/KillPart.luau index 4e557245..39c66df8 100644 --- a/tests/server/Modules/KillPart.luau +++ b/tests/server/Modules/KillPart.luau @@ -12,7 +12,7 @@ local KillDebounce = false local KillPart = {} -function KillPart.Start() +function KillPart.Init() for _, part: Part in KillBricks do part.Touched:Connect(function(basePart) if KillDebounce then diff --git a/wally.toml b/wally.toml index d2dbb2a0..9e780281 100644 --- a/wally.toml +++ b/wally.toml @@ -1,7 +1,7 @@ [package] name = "lumin/framework" description = "A lightning fast & amazing game framework for Roblox" -version = "9.0.0-rc10" +version = "9.0.0-rc11" license = "MIT" registry = "https://github.com/UpliftGames/wally-index" realm = "shared"