Merge pull request #36 from pandorabox-io/buildable-to-fix

check for buildable-to when placing not just air
This commit is contained in:
Sokomine 2019-03-09 22:41:19 +01:00 committed by GitHub
commit b168efc6c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -74,7 +74,9 @@ minetest.register_node("travelnet:travelnet", {
on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.above;
if( minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" ) then
local def = minetest.registered_nodes[
minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name]
if not def or not def.buildable_to then
minetest.chat_send_player( placer:get_player_name(), S('Not enough vertical space to place the travelnet box!'))
return;