avoid nil

This commit is contained in:
RealBadAngel 2013-04-15 08:33:01 +02:00
parent 642b8bec16
commit 595ed50451

View File

@ -8,7 +8,7 @@ minetest.register_globalstep(function(dtime)
for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 1)) do 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 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 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)) inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
if object:get_luaentity().itemstring ~= "" then if object:get_luaentity().itemstring ~= "" then
minetest.sound_play("item_drop_pickup", { minetest.sound_play("item_drop_pickup", {