Fix tablet not being usable when pointing at nothing

This commit is contained in:
Valentin Anger 2017-01-03 18:10:09 +01:00
parent a2a2190947
commit 12f876dee5

View File

@ -1,15 +1,18 @@
local function tablet_use(itemstack, placer, pointed_thing)
minetest.show_formspec(placer:get_player_name(), "sparkdebug:f_tablet",
"size[8,3]" ..
"field[0.25,0.5;8,1;code;Execute;]" ..
"button_exit[0,1;2,1;exit;Send]" ..
"button_exit[2,1;2,1;last;Last]")
return itemstack
end
minetest.register_tool("sparkdebug:tablet", {
description = "Tablet",
inventory_image = "tablet.png",
stack_max = 1,
on_place = function(itemstack, placer, pointed_thing)
minetest.show_formspec(placer:get_player_name(), "sparkdebug:f_tablet",
"size[8,3]" ..
"field[0.25,0.5;8,1;code;Execute;]" ..
"button_exit[0,1;2,1;exit;Send]" ..
"button_exit[2,1;2,1;last;Last]")
return itemstack
end
on_place = tablet_use,
on_secondary_use = tablet_use
})
-- Register callback