Small refactor

Signed-off-by: Rahix <rahix@rahix.de>
dev
rahix 7 years ago
parent 50ae923ef7
commit e8ec24dacc

@ -280,8 +280,7 @@ function BaseControl:set(name, value)
local old = self.local_nouns[name]
self.local_nouns[name] = value
if self.listeners[name] ~= nil then
for id, l in pairs(self.listeners[name]) do
for id, l in pairs(self.listeners[name] or {}) do
if (l.query.ty == Query.Change.ty and value ~= old)
or (l.query.ty == Query.Rising.ty and value > old)
or (l.query.ty == Query.Falling.ty and value < old)
@ -302,7 +301,6 @@ function BaseControl:set(name, value)
end
end
end
end
elseif self.local_verbs[name] ~= nil then
if type(value) ~= "function" then
error("\""..name.."\" can't be cast into a noun")

Loading…
Cancel
Save