Use wielditem drawtype for all nodes in item_entity
authorPilzAdam <adam-k@outlook.com>
Sat, 24 Nov 2012 18:02:16 +0000 (19:02 +0100)
committerPilzAdam <adam-k@outlook.com>
Mon, 26 Nov 2012 17:30:07 +0000 (18:30 +0100)
builtin/item_entity.lua

index 2b12764f18dd455fdcd19653fa6feda8bf4a1873..8657e64af822e9b5ad1ff6c0e4598827a4fb3edd 100644 (file)
@@ -41,17 +41,17 @@ minetest.register_entity("__builtin:item", {
                prop = {
                        is_visible = true,
                        visual = "sprite",
-                       textures = {"unknown_item.png"}
+                       textures = {"unknown_item.png"},
+                       visual_size = {x=0.50, y=0.50}
                }
-               if item_texture and item_texture ~= "" then
-                       prop.visual = "sprite"
-                       prop.textures = {item_texture}
-                       prop.visual_size = {x=0.50, y=0.50}
-               else
+               if item_type == "node" then
                        prop.visual = "wielditem"
                        prop.textures = {itemname}
                        prop.visual_size = {x=0.20, y=0.20}
                        prop.automatic_rotate = math.pi * 0.25
+               elseif item_texture and item_texture ~= "" then
+                       prop.visual = "sprite"
+                       prop.textures = {item_texture}
                end
                self.object:set_properties(prop)
        end,