mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-05 10:00:26 +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
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user