Nyph
Occasional News Reader
- Reaction score
- 87
I've just started using jass over GUI and i have made a knockback function and i can't seem to get to work does anyone know why?
here it is
here it is
JASS:
function knockback takes nothing returns nothing
local timer t = GetExpiredTimer()
local real angle = GetHandleReal(t,"angle")
local unit targ = GetHandleUnit(t,"targ")
local real dist = GetHandleReal(t,"dist")
local real x = GetUnitX(targ)
local real y = GetUnitY(targ)
call SetUnitPosition(targ,PolarProjectionX(x,dist,angle),PolarProjectionY(x,dist,angle))
set t = null
set targ = null
endfunction
function KnockbackUnit takes unit targ, real dist, real angle, real time returns nothing
local timer t
call SetHandleHandle (t,"targ",targ)
call SetHandleReal (t,"dist",dist)
call SetHandleReal (t,"angle",angle)
call TimerStart(t,0.035,true,function knockback)
call PolledWait(time)
call FlushHandleLocals(t)
call DestroyTimer(t)
set t = null
endfunction