mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-24 00:40:20 +01:00
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:
parent
6dec50bff4
commit
c8a55987e6
@ -72,19 +72,11 @@ minetest.register_entity(":__builtin:item", {
|
|||||||
end
|
end
|
||||||
local prop = {
|
local prop = {
|
||||||
is_visible = true,
|
is_visible = true,
|
||||||
visual = "sprite",
|
visual = "wielditem",
|
||||||
textures = {"unknown_item.png"}
|
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)
|
self.object:set_properties(prop)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@ -123,7 +115,7 @@ minetest.register_entity(":__builtin:item", {
|
|||||||
self.timer = 0
|
self.timer = 0
|
||||||
end
|
end
|
||||||
self.timer = self.timer + dtime
|
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()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user