My experience in that the removal timer is never created.
-- Find the owner
local pylon
for i=#pylons_firing, 1, -1 do
local data = pylons_firing[ i ]
if data.expire < CurTime() then
table.remove( pylons_firing, i )
elseif (ent:GetPos() - data.pylon:GetPos()):LengthSqr() < data.pylon.fire_offset:LengthSqr() * 8 then
pylon = data.pylon
table.remove( pylons_firing, i )
break
end
end
if pylon then
timer.Simple( pylon.cball_lifetime, removeCball, ent )
end
This is the important part of the onEntityCreated function, the part that influences the creation of the timer. For the timer to be created, the for loop has to 'return' a pylon (set the local pylon variable to a pylon).
if data.expire < CurTime() then
table.remove( pylons_firing, i )
In my testing, this if statement is what is preventing the timer from being created. data.expire is set to CurTime() + 0.25 farther down in the file. If my logic is correct, this means the combine ball needs to be shot within .25 seconds. The
line setting the expire time seems to suggest it is set to .25 seconds because that is how long the combine ball takes to spawn.
I will say that even setting the expire time to something higher (5 seconds) does not fix the issue, so the expire time is not exclusively to blame. However, I'm still unsure what purpose the expire time serves.
edit:Should we move this discussion elsewhere, maybe the old UDodge thread or a new thread altogether?