library CleanItems initializer onInit
globals
private constant real TIMEOUT = 1800
//time for the system to clean up every TIMEOUT seconds from the map start
endglobals
private function enum takes nothing returns nothing
call RemoveItem(GetEnumItem())
endfunction
private function cleanItems takes nothing returns boolean
call EnumItemsInRect(GetWorldBounds(), null, function enum)
return false
endfunction
private function onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t, TIMEOUT, true)
call TriggerAddCondition(t, Condition(function cleanItems))
set t = null
endfunction
endlibrary