Добавлен Darknessay
Принятый ответ
Написал общую функцию EnumDestructablesInRange.
раскрыть
globals
real TrasmittedX
real TrasmittedY
real TrasmittedRange
endglobals
function GetDistancePoints takes real x1, real y1, real x2, real y2 returns real
return SquareRoot((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))
endfunction
function FilterFunc takes nothing returns boolean
return TrasmittedRange >= GetDistancePoints(TrasmittedX, TrasmittedY,/*
*/ GetDestructableX(GetFilterDestructable()), GetDestructableY(GetFilterDestructable()))
endfunction
function EnumDestructablesInRange takes real x, real y, real range, code callback returns nothing
set TrasmittedX = x
set TrasmittedY = y
set TrasmittedRange = range
call EnumDestructablesInRect(GetWorldBounds(), Filter(function FilterFunc), callback)
endfunction
function KillDestructiblesInRangeCallback takes nothing returns boolean
call KillDestructable(GetEnumDestructable())
endfunction
function KillDestructiblesInRange takes real x, real y, real range returns boolean
call EnumDestructablesInRange(x, y, range, function KillDestructiblesInRangeCallback)
endfunction
`
ОЖИДАНИЕ РЕКЛАМЫ...
Чтобы оставить комментарий, пожалуйста, войдите на сайт.
Кодом скинь, покажу
Короче, без глобалок не обойтись походу?
Ред. Феникс
Ред. PT153