forked from VoxeLibre/VoxeLibre
Fix crash when placing fishbucket on buildable_to above unknown
This commit is contained in:
parent
a5a952896d
commit
12727a6a0a
|
@ -21,7 +21,8 @@ local function on_place_fish(itemstack, placer, pointed_thing)
|
||||||
local pos = pointed_thing.above or pointed_thing.under
|
local pos = pointed_thing.above or pointed_thing.under
|
||||||
if not pos then return end
|
if not pos then return end
|
||||||
local n = minetest.get_node_or_nil(pos)
|
local n = minetest.get_node_or_nil(pos)
|
||||||
if n.name and minetest.registered_nodes[n.name].buildable_to or n.name == "mcl_portals:portal" then
|
local def = minetest.registered_nodes[n.name]
|
||||||
|
if def and def.buildable_to or n.name == "mcl_portals:portal" then
|
||||||
local fish = itemstack:get_name():gsub(fishbucket_prefix,"")
|
local fish = itemstack:get_name():gsub(fishbucket_prefix,"")
|
||||||
if fish_names[fish] then
|
if fish_names[fish] then
|
||||||
local o = minetest.add_entity(pos, "mobs_mc:" .. fish)
|
local o = minetest.add_entity(pos, "mobs_mc:" .. fish)
|
||||||
|
|
Loading…
Reference in New Issue