Minor tweaks __builtin:falling_node
authorRui <Rui914@users.noreply.github.com>
Mon, 31 Aug 2015 21:57:12 +0000 (06:57 +0900)
committerest31 <MTest31@outlook.com>
Tue, 1 Sep 2015 17:14:08 +0000 (19:14 +0200)
builtin/game/falling.lua

index 58f68fc56f51525f404436a9029e13d21c505d3c..5b5e806f526af72fbc0417664244ce2445d11866 100644 (file)
@@ -18,18 +18,6 @@ core.register_entity(":__builtin:falling_node", {
 
        set_node = function(self, node)
                self.node = node
-               local stack = ItemStack(node.name)
-               local itemtable = stack:to_table()
-               local itemname = nil
-               if itemtable then
-                       itemname = stack:to_table().name
-               end
-               local item_texture = nil
-               local item_type = ""
-               if core.registered_items[itemname] then
-                       item_texture = core.registered_items[itemname].inventory_image
-                       item_type = core.registered_items[itemname].type
-               end
                local prop = {
                        is_visible = true,
                        textures = {node.name},
@@ -43,7 +31,9 @@ core.register_entity(":__builtin:falling_node", {
 
        on_activate = function(self, staticdata)
                self.object:set_armor_groups({immortal=1})
-               self:set_node({name=staticdata})
+               if staticdata then
+                       self:set_node({name=staticdata})
+               end
        end,
 
        on_step = function(self, dtime)