mirror of
https://github.com/Keyslam-Group/Concord.git
synced 2025-09-02 12:24:11 -04:00
Fixed a little typo and systems not behaving correctly when added to a Instance multiple times.
This commit is contained in:
parent
acd77fafa5
commit
2b377bea24
1 changed files with 4 additions and 4 deletions
|
@ -77,8 +77,8 @@ end
|
|||
-- @param enabled If the system is enabled. Defaults to true
|
||||
-- @return self
|
||||
function Instance:addSystem(system, eventName, callback, enabled)
|
||||
if system.__instance then
|
||||
error("System already in instance '" ..system.__instance.."'")
|
||||
if system.__instance and system.__instance ~= self then
|
||||
error("System already in instance '" ..tostring(system.__instance).."'")
|
||||
end
|
||||
|
||||
if not self.systems:has(system) then
|
||||
|
@ -133,8 +133,8 @@ function Instance:setSystem(system, eventName, callback, enable)
|
|||
for i = 1, #listeners do
|
||||
local listener = listeners[i]
|
||||
|
||||
if listerner.callback == callback then
|
||||
listerner.enabled = enable
|
||||
if listener.callback == callback then
|
||||
listener.enabled = enable
|
||||
break
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue