forked from mtcontrib/mobs_redo
bugfix
This commit is contained in:
parent
646020db94
commit
ff4dfe4b4d
5
api.lua
5
api.lua
@ -320,7 +320,7 @@ end
|
|||||||
-- drop items
|
-- drop items
|
||||||
function item_drop(self, cooked)
|
function item_drop(self, cooked)
|
||||||
|
|
||||||
local obj, ent, item, num
|
local obj, item, num
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
|
|
||||||
self.drops = self.drops or {} -- nil check
|
self.drops = self.drops or {} -- nil check
|
||||||
@ -345,9 +345,8 @@ function item_drop(self, cooked)
|
|||||||
|
|
||||||
-- add item if it exists
|
-- add item if it exists
|
||||||
obj = minetest.add_item(pos, ItemStack(item .. " " .. num))
|
obj = minetest.add_item(pos, ItemStack(item .. " " .. num))
|
||||||
ent = obj:get_luaentity()
|
|
||||||
|
|
||||||
if ent then
|
if obj and obj:get_luaentity() then
|
||||||
|
|
||||||
obj:setvelocity({
|
obj:setvelocity({
|
||||||
x = random(-10, 10) / 9,
|
x = random(-10, 10) / 9,
|
||||||
|
Loading…
Reference in New Issue
Block a user