set BoundaryLeftX = GetRectMinX(Ваша область)
set BoundaryRightX = GetRectMaxX(Ваша область)
set BoundaryBottomY = GetRectMinY(Ваша область)
set BoundaryTopY = GetRectMaxY(Ваша область)
set BoundaryRightX = GetRectMaxX(Ваша область)
set BoundaryBottomY = GetRectMinY(Ваша область)
set BoundaryTopY = GetRectMaxY(Ваша область)
`function SetUnitXY takes unit u, real NewX, real NewY returns nothing
if NewX < BoundaryLeftX then
set NewX = BoundaryLeftX
endif
if NewX > BoundaryRightX then
set NewX = BoundaryRightX
endif
if NewY < BoundaryBottomY then
set NewY = BoundaryBottomY
endif
if NewY > BoundaryTopY then
set NewY = BoundaryTopY
endif
if NewX < BoundaryLeftX then
set NewX = BoundaryLeftX
endif
if NewX > BoundaryRightX then
set NewX = BoundaryRightX
endif
if NewY < BoundaryBottomY then
set NewY = BoundaryBottomY
endif
if NewY > BoundaryTopY then
set NewY = BoundaryTopY
endif
call SetUnitX( u, NewX )
call SetUnitY( u, NewY )
endfunction`
call SetUnitY( u, NewY )
endfunction`
Использование
call SetUnitXY(Caster, CastX, CastY)

WC3



