I'm trying to make a dummy unit (to make it use thunder clap) when dash skill is finished.
So i announced local unit u in the timer-looping function, but it is only used when the loop is finished. (set u = CreateUnit~)
In this case, should I put "set u = null" inside the [if then] before calling "destroy()"?
Or should I put it where it is now (at the end, nulling it everytime timer loops before dash is not finished)?
Thanks in advance.
So i announced local unit u in the timer-looping function, but it is only used when the loop is finished. (set u = CreateUnit~)
In this case, should I put "set u = null" inside the [if then] before calling "destroy()"?
Or should I put it where it is now (at the end, nulling it everytime timer loops before dash is not finished)?
Thanks in advance.
JASS:
private function FWalk_Act takes nothing returns nothing
local unit u
local data d = GetTimerStructA(GetExpiredTimer())
set d.z = d.z - d.speed
set d.x = d.x + d.speed * Cos(d.angle * bj_DEGTORAD)
set d.y = d.y + d.speed * Sin(d.angle * bj_DEGTORAD)
if d.z <= -15.00 then
set u = CreateUnit(GetOwningPlayer(d.c), 'h000', d.x, d.y, 0.00)
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', u )
call d.destroy()
else
set Index = d
call SetUnitX(d.c,d.x)
call SetUnitY(d.c,d.y)
endif
set u = null
endfunction