From 038aece5f782111197af295655f6bd6ec3e2c414 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Tue, 31 May 2016 17:31:19 +0100 Subject: [PATCH] fix obj nil bug --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 679cebf..061b184 100644 --- a/init.lua +++ b/init.lua @@ -241,7 +241,9 @@ function minetest.is_protected(pos, digger) -- drop stack local obj = minetest.add_item(player:getpos(), sta) - obj:setvelocity({x = 0, y = 5, z = 0}) + if obj then + obj:setvelocity({x = 0, y = 5, z = 0}) + end end) end