- Joined
- May 27, 2009
- Messages
- 495
I'm currently making some sort of little library
unfortunately.. i can't make it work the way it should be..
What i want is.. make the SetUnitFlyHeight (in this case, SetUnitFlyHeightEx) take effect only one at a time per unit
meaning, only one call at a time will work(for a specific unit) and later calls will be ignored.. then if the first call has ended accept queued or those calls that was initiated during the first call of the function
here's my code o.o
it's pretty simeple.. but my problem here is that yeah only one call per unit will work.. but queued calls are being ignored
well i guess due to the fact that int-1 doesn't have enough checks i guess
unfortunately.. i can't make it work the way it should be..
What i want is.. make the SetUnitFlyHeight (in this case, SetUnitFlyHeightEx) take effect only one at a time per unit
meaning, only one call at a time will work(for a specific unit) and later calls will be ignored.. then if the first call has ended accept queued or those calls that was initiated during the first call of the function
here's my code o.o
JASS:
function FlyUnit takes unit u returns integer
if UnitAddAbility(u,'Arav') then
call UnitRemoveAbility(u,'Arav')
endif
call SaveInteger(ht,GetHandleId(u),0,LoadInteger(ht,GetHandleId(u),0)+1)
return LoadInteger(ht,GetHandleId(u),0)
endfunction
function SetUnitFlyHeightEx takes unit u, real height, boolean b, integer index returns nothing
local integer int = LoadInteger(ht,GetHandleId(u),0)
if index == 1 then
call SetUnitFlyHeight(u,height,0)
endif
if not b then
call SaveInteger(ht,GetHandleId(u),0,int-1)
endif
endfunction
it's pretty simeple.. but my problem here is that yeah only one call per unit will work.. but queued calls are being ignored
well i guess due to the fact that int-1 doesn't have enough checks i guess