mirror of
https://github.com/Keyslam-Group/Concord.git
synced 2025-09-03 04:43:56 -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
|
-- @param enabled If the system is enabled. Defaults to true
|
||||||
-- @return self
|
-- @return self
|
||||||
function Instance:addSystem(system, eventName, callback, enabled)
|
function Instance:addSystem(system, eventName, callback, enabled)
|
||||||
if system.__instance then
|
if system.__instance and system.__instance ~= self then
|
||||||
error("System already in instance '" ..system.__instance.."'")
|
error("System already in instance '" ..tostring(system.__instance).."'")
|
||||||
end
|
end
|
||||||
|
|
||||||
if not self.systems:has(system) then
|
if not self.systems:has(system) then
|
||||||
|
@ -133,8 +133,8 @@ function Instance:setSystem(system, eventName, callback, enable)
|
||||||
for i = 1, #listeners do
|
for i = 1, #listeners do
|
||||||
local listener = listeners[i]
|
local listener = listeners[i]
|
||||||
|
|
||||||
if listerner.callback == callback then
|
if listener.callback == callback then
|
||||||
listerner.enabled = enable
|
listener.enabled = enable
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue