Fix crash placing mob spawners on unknown

This commit is contained in:
cora 2023-09-04 02:05:43 +02:00 committed by MrRar
parent 681244de71
commit 43377ee4b9
1 changed files with 2 additions and 1 deletions

View File

@ -301,7 +301,8 @@ minetest.register_node("mcl_mobspawners:spawner", {
local new_itemstack, success = minetest.item_place(itemstack, placer, pointed_thing)
if success then
local placepos
if minetest.registered_nodes[node_under.name].buildable_to then
local def = minetest.registered_nodes[node_under.name]
if def and def.buildable_to then
placepos = pointed_thing.under
else
placepos = pointed_thing.above