Applied cornernote's fix for the previous check-for-space attempt.

This commit is contained in:
Vanessa Ezekowitz 2012-10-03 04:12:36 -04:00
parent 328633d60e
commit 701e5fdd52

View File

@ -39,13 +39,13 @@ minetest.register_node('homedecor:refrigerator', {
inv:set_size("main",50) inv:set_size("main",50)
end, end,
after_place_node = function(pos, placer) on_place = function(itemstack, placer, pointed_thing)
ntop = minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}) local pos = pointed_thing.above
if ntop.name ~= "air" then if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then
minetest.env:remove_node(pos)
placer:get_inventory():add_item("main", "homedecor:refrigerator")
minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a refrigerator!' ) minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place a refrigerator!' )
return
end end
return minetest.item_place(itemstack, placer, pointed_thing)
end, end,
can_dig = function(pos,player) can_dig = function(pos,player)