ruby: extend item_find to work on constructed coffers

develop
jj 2012-07-04 17:48:44 +02:00
parent cdd711efa4
commit 7c4f60df1d
1 changed files with 3 additions and 2 deletions

@ -15,8 +15,9 @@ module DFHack
when :Item
k.item
when :Building
# hilight a constructed bed
k.building.contained_items[0].item if k.building.contained_items.length == 1
# hilight a constructed bed/coffer
mats = k.building.contained_items.find_all { |i| i.use_mode == 2 }
mats[0].item if mats.length == 1
end
when :BuildingItems
bld = world.selected_building