add get_wield_item_stack function

This commit is contained in:
tacigar 2016-12-06 13:23:41 +09:00
parent 99bf40dcf1
commit 47cd917363

View File

@ -120,6 +120,15 @@ function maidroid.maidroid.set_yaw_by_direction(self, direction)
self.object:setyaw(math.atan2(direction.z, direction.x) + math.pi / 2)
end
-- maidroid.maidroid.get_wield_item_info returns the maidroid's wield item's stack.
function maidroid.maidroid.get_wield_item_stack(self)
local inv = self:get_inventory()
if inv:is_empty("wield_item") then
return nil
end
return inv:get_stack(1)
end
---------------------------------------------------------------------
-- maidroid.manufacturing_data represents a table that contains manufacturing data.