avoid nil
authorRealBadAngel <mk@realbadangel.pl>
Mon, 15 Apr 2013 06:33:01 +0000 (08:33 +0200)
committerRealBadAngel <mk@realbadangel.pl>
Mon, 15 Apr 2013 06:33:01 +0000 (08:33 +0200)
item_drop/init.lua

index 8cd3b14e0870229d2e38cdb92f19c1f52342d55a..f51469b64e418291723280482c858a09d4e80754 100644 (file)
@@ -8,7 +8,7 @@ minetest.register_globalstep(function(dtime)
                for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 1)) do
                        if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
                                if inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
-                                       if object:get_luaentity().timer > time_pick then
+                                       if object:get_luaentity() and object:get_luaentity().timer > time_pick then
                                                inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
                                                if object:get_luaentity().itemstring ~= "" then
                                                        minetest.sound_play("item_drop_pickup", {
@@ -137,4 +137,4 @@ minetest.register_on_dieplayer(function(name, pos)
        end
 end)
 ]]--
-print("DROPS LOADED!")
\ No newline at end of file
+print("DROPS LOADED!")