improve builtin_item, all items rotates now,

items spawned with drop= "" are removed directly, they are no longer on the map, before they were deleted after the ttl or through item_drop
This commit is contained in:
crabman77 2015-10-28 16:20:15 +01:00
parent 6dec50bff4
commit c8a55987e6
1 changed files with 5 additions and 13 deletions

View File

@ -72,19 +72,11 @@ minetest.register_entity(":__builtin:item", {
end
local prop = {
is_visible = true,
visual = "sprite",
textures = {"unknown_item.png"}
visual = "wielditem",
textures = {(itemname or "unknown_item.png")},
visual_size = {x=0.25, y=0.25},
automatic_rotate = math.pi * 0.5,
}
if item_texture and item_texture ~= "" then
prop.visual = "wielditem"
prop.textures = {itemname}
prop.visual_size = {x=0.25, y=0.25}
else
prop.visual = "wielditem"
prop.textures = {itemname}
prop.visual_size = {x=0.25, y=0.25}
prop.automatic_rotate = math.pi * 0.5
end
self.object:set_properties(prop)
end,
@ -123,7 +115,7 @@ minetest.register_entity(":__builtin:item", {
self.timer = 0
end
self.timer = self.timer + dtime
if time ~= 0 and (self.timer > time) then
if self.itemstring == "" or (time ~= 0 and (self.timer > time)) then
self.object:remove()
return
end