Only display “home” button with home privilege
This commit is contained in:
parent
73627499da
commit
66ddd2571c
|
@ -338,6 +338,9 @@ i4.new_footer_button("home", {
|
|||
description = S"Go home",
|
||||
image = "i3_home.png",
|
||||
fields = home_footer_fields,
|
||||
access = function(player, data)
|
||||
return minetest.check_player_privs(player:get_player_name(), {home = true})
|
||||
end
|
||||
})
|
||||
|
||||
i4.register_craft_type("digging", {
|
||||
|
|
|
@ -615,8 +615,10 @@ local function settings_footer_fs(player, data, fs)
|
|||
-- i4 stores home coordinates with one decimal of precision, as the blow fmt() statement
|
||||
-- assumes. So we need to trim sethome’s coordinates to one decimal, likewise.
|
||||
local home_pos = sethome.get(player:get_player_name())
|
||||
if home_pos then
|
||||
home = string.format("(%.1f,%.1f,%.1f)", home_pos.x, home_pos.y, home_pos.z)
|
||||
end
|
||||
end
|
||||
|
||||
if home then
|
||||
str = home:gsub(",", " "):sub(2,-2):gsub("%.%d", ""):gsub(
|
||||
|
|
Ŝarĝante…
Reference in New Issue