summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2017-05-27 18:36:30 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2017-05-27 18:36:30 +0100
commitff4dfe4b4dbd5f5e58f0bfdd0d2cd34bfe9d144f (patch)
treeb6eee244aa386c24305495858ac9db4414046879
parent646020db9497a6447329d2cba7ae53a81e196d5c (diff)
bugfix
-rw-r--r--api.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/api.lua b/api.lua
index 971e112..7cf6db0 100644
--- a/api.lua
+++ b/api.lua
@@ -320,7 +320,7 @@ end
-- drop items
function item_drop(self, cooked)
- local obj, ent, item, num
+ local obj, item, num
local pos = self.object:getpos()
self.drops = self.drops or {} -- nil check
@@ -345,9 +345,8 @@ function item_drop(self, cooked)
-- add item if it exists
obj = minetest.add_item(pos, ItemStack(item .. " " .. num))
- ent = obj:get_luaentity()
- if ent then
+ if obj and obj:get_luaentity() then
obj:setvelocity({
x = random(-10, 10) / 9,