Merge pull request #117 from BClark09/master

2 commits regarding custom entities
This commit is contained in:
William Moodhe / JetBoom 2015-01-30 21:44:42 -05:00
commit b696386ca1
2 changed files with 8 additions and 4 deletions

View file

@ -40,7 +40,11 @@ end
function SWEP:Deploy() function SWEP:Deploy()
if SERVER then if SERVER then
self.Owner:SelectWeapon("weapon_zs_fists") if GAMEMODE.ZombieEscape then
self.Owner:SelectWeapon("weapon_zs_zeknife")
else
self.Owner:SelectWeapon("weapon_zs_fists")
end
end end
return true return true
end end

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