diff --git a/init.lua b/init.lua index 37574ac..1e42ce8 100644 --- a/init.lua +++ b/init.lua @@ -340,7 +340,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local coords = coords_from_string(fields.coords) if coords then set_compass_meta_pos(meta, coords) - end + elseif fields.coords == "" then + -- assume player wants to reset compass + meta:set_string("waypoint_compass:position", "") -- TODO make unset()? + -- TODO reset label too? or keep it to be safe? + end local label = fields.label set_compass_meta_label(meta, label)