function SetUnitPosition takes unit u, real x, real y returns nothing
if x < GetRectMaxX( bj_mapInitialPlayableArea ) and x > GetRectMinX( bj_mapInitialPlayableArea ) and y < GetRectMaxY( bj_mapInitialPlayableArea ) and y > GetRectMinY( bj_mapInitialPlayableArea ) then
call SetUnitX( u, x )
call SetUnitY( u, y )
endif
call PauseUnit( u, true )
call PauseUnit( u, false )
endfunction