evaera / matter

A modern ECS library for Roblox.
https://eryn.io/matter/
MIT License
144 stars 34 forks source link

Systems with undefined dependencies cause crash #56

Closed metrowaii closed 1 year ago

metrowaii commented 1 year ago

A system that should run after an undefined system causes a crash.

Minimum repro;

local loop = Loop.new()
local order = {}
local systemA = {system = function() end)
local systemB = {system = function() end, after = {systemA})

loop:scheduleSystems({})
loop:scheduleSystem(systemB)
loop:scheduleSystem(systemA)

In this example systemB has a dependency on systemA, but is scheduled before systemA which results in the crash

Issue originally reported by @benbrimeyer