forked from mtcontrib/maidroid
add get_wield_item_stack function
This commit is contained in:
parent
99bf40dcf1
commit
47cd917363
@ -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)
|
self.object:setyaw(math.atan2(direction.z, direction.x) + math.pi / 2)
|
||||||
end
|
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.
|
-- maidroid.manufacturing_data represents a table that contains manufacturing data.
|
||||||
|
Loading…
Reference in New Issue
Block a user