im trying to make an orbit function, and this is how im doing it, i made a perioic timer in the original Actions function and have it execute this every 0.02 seconds.
but for some reason this function leaks and i dont know why. and yes im sure it leaks becuase after a few mins of running wc3 the mem usage in task manager is sky high.
Help!
but for some reason this function leaks and i dont know why. and yes im sure it leaks becuase after a few mins of running wc3 the mem usage in task manager is sky high.
Help!
Code:
function Generator_Orbit takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit caster=GetCaster(t)
local real orbitangle=GetOrbitAngle(t)
local unit generator=GetGenerator(t)
local real x
local real y
set x=200*CosBJ(2*orbitangle)
set y=200*SinBJ(2*orbitangle)
call SetUnitX(generator, GetUnitX(caster)+x)
call SetUnitY(generator,GetUnitY(caster)+y)
if orbitangle==360 then
set orbitangle=0
else
set orbitangle=orbitangle+1
endif
call SetHandleReal(t,"orbitangle",orbitangle)
set t=null
set caster=null
set generator=null
endfunction