From b49427f28311cd70fcb06d5795353749e9e0ed75 Mon Sep 17 00:00:00 2001 From: whosit Date: Fri, 28 May 2021 10:41:58 +0300 Subject: [PATCH] if label is empty, show coords instead --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index ce57598..f94b651 100644 --- a/init.lua +++ b/init.lua @@ -23,7 +23,7 @@ end local function set_compass_meta_label(meta, label) meta:set_string("waypoint_compass:label", label) - if label == "coords" then + if label == "" then local pos = get_compass_meta_pos(meta) if pos then meta:set_string("description", string.format("Waypoint compass to %s", minetest.pos_to_string(pos))) @@ -44,7 +44,7 @@ end local function set_compass_meta_pos(meta, pos) local pos_str = minetest.pos_to_string(pos) meta:set_string("waypoint_compass:position", pos_str) - if get_compass_meta_label(meta) == "coords" then + if get_compass_meta_label(meta) == "" then meta:set_string("description", string.format("Waypoint compass to %s", minetest.pos_to_string(pos))) end end @@ -112,7 +112,7 @@ local function show_hud_waypoint(player, compass_item_meta) local waypoint_pos = get_compass_meta_pos(compass_item_meta) local waypoint_name = get_compass_meta_label(compass_item_meta) -- show coords instead of name - if waypoint_name == "coords" and waypoint_pos then + if waypoint_name == "" and waypoint_pos then waypoint_name = minetest.pos_to_string(waypoint_pos) end local waypoint_color = get_compass_meta_color(compass_item_meta)