Weyrling
New Member
- Reaction score
- 25
X & Y are the distance the unit is supposed to be moved on either axis.
The testX & testY are to make sure the unit doesn't fly out of the area.
The units are moved and slow down perfectly, but they go all the way down to 0 speed and still aren't removed.
I've been working on this for too long, so I figure I'll ask somebody else.
The testX & testY are to make sure the unit doesn't fly out of the area.
JASS:
function VMoveUnit takes unit u returns nothing
local integer i = GetUnitUserData(u)
local real testX = GetUnitX(u)+X<i>
local real testY = GetUnitY(u)+Y<i>
if testX > 4000 or testX < -4000 or testY > 4000 or testY < -4000 then
call RemoveFromSystem(u)
return
endif
//This line, not working:
if (RAbsBJ(testX-GetUnitX(u)) <= 10) and (RAbsBJ(testY-GetUnitY(u)) <= 10) then
//Right Here ^^
call RemoveFromSystem(u)
endif
call SetUnitX(u,(GetUnitX(u)+X<i>)*Friction())
call SetUnitY(u,(GetUnitY(u)+Y<i>)*Friction())
endfunction</i></i></i></i>
The units are moved and slow down perfectly, but they go all the way down to 0 speed and still aren't removed.
I've been working on this for too long, so I figure I'll ask somebody else.