explosion function now drops items inside bones
This commit is contained in:
parent
99810d33c1
commit
44229230df
9
api.lua
9
api.lua
@ -1610,18 +1610,19 @@ function mobs:explosion(pos, radius, fire, smoke, sound)
|
|||||||
and data[vi] ~= c_brick
|
and data[vi] ~= c_brick
|
||||||
and data[vi] ~= c_chest then
|
and data[vi] ~= c_chest then
|
||||||
|
|
||||||
--local n = node_ok(p).name
|
local n = node_ok(p).name
|
||||||
local n = minetest.get_name_from_content_id(data[vi])
|
|
||||||
if minetest.get_item_group(n, "unbreakable") ~= 1 then
|
if minetest.get_item_group(n, "unbreakable") ~= 1 then
|
||||||
|
|
||||||
-- if chest then drop items inside
|
-- if chest then drop items inside
|
||||||
if n == "default:chest"
|
if n == "default:chest"
|
||||||
or n == "3dchest:chest" then
|
or n == "3dchest:chest"
|
||||||
|
or n == "bones:bones" then
|
||||||
|
|
||||||
local meta = minetest.get_meta(p)
|
local meta = minetest.get_meta(p)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
|
||||||
for i = 1, 32 do
|
for i = 1, inv:get_size("main") do
|
||||||
|
|
||||||
local m_stack = inv:get_stack("main", i)
|
local m_stack = inv:get_stack("main", i)
|
||||||
local obj = minetest.add_item(p, m_stack)
|
local obj = minetest.add_item(p, m_stack)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user