From 47cd917363a02e549a32a417c2dd4ba70af4c282 Mon Sep 17 00:00:00 2001 From: tacigar Date: Tue, 6 Dec 2016 13:23:41 +0900 Subject: [PATCH] add get_wield_item_stack function --- maidroid/api.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/maidroid/api.lua b/maidroid/api.lua index 5c60f1e..de78200 100644 --- a/maidroid/api.lua +++ b/maidroid/api.lua @@ -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.