Knockback system not removing

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.
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 &gt; 4000 or testX &lt; -4000 or testY &gt; 4000 or testY &lt; -4000 then
        call RemoveFromSystem(u)
        return
    endif
    //This line, not working:
    if (RAbsBJ(testX-GetUnitX(u)) &lt;= 10) and (RAbsBJ(testY-GetUnitY(u)) &lt;= 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.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top