library KillTreesInRect requires DestructableLib
globals
private rect TempRect = Rect(0,0,0,0)
endglobals
private function KillTrees takes nothing returns boolean
// Note, use GetFilterDestructable since we're doing it inside a boolexpr.
if IsDestructableTree(GetFilterDestructable()) and not IsDestructableDead(GetFilterDestructable()) then
call KillDestructable(GetFilterDestructable())
endif
return false
endfunction
function KillTreesInRect takes real x, real y, real radius returns nothing
call SetRect(TempRect,x-radius,y-radius,x+radius,y+radius)
call EnumDestructablesInRect(TempRect,Filter(function KillTrees),null)
endfunction
endlibrary