mirror of
https://github.com/tacigar/maidroid.git
synced 2025-01-25 06:50:22 +01:00
Fix wield item entity
This commit is contained in:
parent
63467d8337
commit
7c32c4fb34
@ -251,7 +251,7 @@ do
|
|||||||
if maidroid.is_maidroid(luaentity.name) then
|
if maidroid.is_maidroid(luaentity.name) then
|
||||||
self.object:set_attach(obj, "Arm_R", {x = 0.075, y = 0.60, z = -0.20}, {x = 0, y = 90, z = 0})
|
self.object:set_attach(obj, "Arm_R", {x = 0.075, y = 0.60, z = -0.20}, {x = 0, y = 90, z = 0})
|
||||||
self.object:set_properties{textures={"maidroid:dummy_empty_craftitem"}}
|
self.object:set_properties{textures={"maidroid:dummy_empty_craftitem"}}
|
||||||
break
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -263,6 +263,7 @@ do
|
|||||||
|
|
||||||
if maidroid.is_maidroid(luaentity.name) then
|
if maidroid.is_maidroid(luaentity.name) then
|
||||||
local stack = luaentity:get_wield_item_stack()
|
local stack = luaentity:get_wield_item_stack()
|
||||||
|
|
||||||
if stack:get_name() ~= itemname then
|
if stack:get_name() ~= itemname then
|
||||||
if stack:is_empty() then
|
if stack:is_empty() then
|
||||||
self.itemname = ""
|
self.itemname = ""
|
||||||
@ -272,9 +273,12 @@ do
|
|||||||
self.object:set_properties{textures={self.itemname}}
|
self.object:set_properties{textures={self.itemname}}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
break
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- if cannot find maidroid, delete empty item.
|
||||||
|
self.object:remove()
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_entity("maidroid:dummy_item", {
|
minetest.register_entity("maidroid:dummy_item", {
|
||||||
|
Loading…
Reference in New Issue
Block a user