------------------------ Функции -"much" ------------------------

local reloc_params={} 
local stalk

function out_item_much(itm_section,need_number) 
    reloc_params.itm_section=itm_section 
    reloc_params.itm_cnt=need_number 
    reloc_params.itm_cnt_found=0 
    db.actor:iterate_inventory(checkout_items_count,db.actor) 
    reloc_params.itm_cnt_found=0 
		if reloc_params.itm_cnt_found<=reloc_params.itm_cnt then 
		db.actor:iterate_inventory(out_items_count,db.actor) 
		end 
     news_manager.relocate_item(db.actor, "out", itm_section) 
     reloc_params={} 
end
 
function checkout_items_count(actor,item) 
    if item.section and item:section()==reloc_params.itm_section then 
     reloc_params.itm_cnt_found = reloc_params.itm_cnt_found + 1 
    end 
end
 
function out_items_count(actor,item) 
    if item.section and item:section()==reloc_params.itm_section and reloc_params.itm_cnt_found<reloc_params.itm_cnt then 
    items.remove_item_from_inventory(item, actor) 
    reloc_params.itm_cnt_found = reloc_params.itm_cnt_found + 1 
    end 
end 