From 43c9984d574f997da9fa0eea4ae14fca090abc40 Mon Sep 17 00:00:00 2001 From: stujones11 Date: Tue, 1 Aug 2017 18:42:04 +0100 Subject: [PATCH] Do not drop armor in uloaded areas --- 3d_armor/api.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/3d_armor/api.lua b/3d_armor/api.lua index 4981f88..d522190 100644 --- a/3d_armor/api.lua +++ b/3d_armor/api.lua @@ -463,8 +463,11 @@ armor.get_valid_player = function(self, player, msg) end armor.drop_armor = function(pos, stack) - local obj = minetest.add_item(pos, stack) - if obj then - obj:setvelocity({x=math.random(-1, 1), y=5, z=math.random(-1, 1)}) + local node = minetest.get_node_or_nil(pos) + if node then + local obj = minetest.add_item(pos, stack) + if obj then + obj:setvelocity({x=math.random(-1, 1), y=5, z=math.random(-1, 1)}) + end end end