1 What is handle attach system is?
2 How to check that the unit is not moving or moving?
Yes I know how to store the x and y, but how to check the current position in periodic event trigger. Using wait actions?
struct data
real x
real y
unit u
endstruct
function callback takes nothing returns boolean
local data d = KT_GetData()
if d.x != GetUnitX(d.u) and d.y != GetUnitY(d.u) then
call d.destroy()
return true
endif
return false
endfunction
function init takes nothing returns nothing
local data d = data.create()
set d.u = GetTriggerUnit()
set d.x = GetUnitX(d.u)
set d.y = GetUnitY(d.u)
call KT_Add(function callback, d, .05)
endfunciton
Yes I know how to store the x and y, but how to check the current position in periodic event trigger. Using wait actions?