Added a system to chain arguments through source and gamemode entities.

This commit is contained in:
Ben 2015-01-30 23:55:12 +00:00
parent a6a7e19653
commit f6034b5296

View file

@ -87,14 +87,14 @@ function meta:FireOutput(outpt, activator, caller, args)
local intab = self[outpt] local intab = self[outpt]
if intab then if intab then
for key, tab in pairs(intab) do for key, tab in pairs(intab) do
local param = ((tab.args == "") and args) or tab.args
for __, subent in pairs(self:FindByNameHammer(tab.entityname, activator, caller)) do for __, subent in pairs(self:FindByNameHammer(tab.entityname, activator, caller)) do
local delay = tonumber(tab.delay) local delay = tonumber(tab.delay)
if delay == nil or delay <= 0 then if delay == nil or delay <= 0 then
subent:Input(tab.input, activator, caller, tab.args) subent:Input(tab.input, activator, caller, param)
else else
local inp = tab.input local inp = tab.input
local args = tab.args timer.Simple(delay, function() if subent:IsValid() then subent:Input(inp, activator, caller, param) end end)
timer.Simple(delay, function() if subent:IsValid() then subent:Input(inp, activator, caller, args) end end)
end end
end end
end end