From 877b879e57b6c080a38df1d3a1af27530acf4eb2 Mon Sep 17 00:00:00 2001 From: jj Date: Tue, 3 Jul 2012 23:57:15 +0200 Subject: [PATCH] ruby: item_find handle v/i unit inventory --- plugins/ruby/item.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/ruby/item.rb b/plugins/ruby/item.rb index 87917bad5..5df1aed87 100644 --- a/plugins/ruby/item.rb +++ b/plugins/ruby/item.rb @@ -15,6 +15,10 @@ module DFHack when :BuildingItems bld = world.selected_building bld.contained_items[ui_building_item_cursor].item if bld + when :ViewUnits + u = world.units.active[ui_selected_unit] + u.inventory[ui_look_cursor].item if u and u.pos.z == cursor.z and + ui_unit_view_mode == :Inventory and u.inventory[ui_look_cursor] end end elsif what.kind_of?(Integer)