[mobs] Prevent crash when on_blast returns nil

This commit is contained in:
LeMagnesium 2018-02-10 22:33:58 +01:00
parent 3189da0e3e
commit 6ab9adf55c
No known key found for this signature in database
GPG Key ID: A54DDB5272C51E8B

View File

@ -2381,7 +2381,7 @@ function mobs:explosion(pos, radius, fire, smoke, sound)
local on_blast = minetest.registered_nodes[n].on_blast
if on_blast then
local drops = on_blast(p) -- MFF(Lymkwi) : Chests and bones return their drops now
local drops = on_blast(p) or {} -- MFF(Lymkwi) : Chests and bones return their drops now
for _, name in ipairs(drops) do
local obj = minetest.add_item(p, ItemStack(name))
if obj then