From a0c0a8bad715e58ffae0b6ae23e9b58bce041bde Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Mon, 12 Apr 2021 00:38:24 +0200 Subject: [PATCH] Another fix --- init.lua | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index c6aa831..c6cb560 100644 --- a/init.lua +++ b/init.lua @@ -2991,19 +2991,17 @@ local function init_waypoints(player) data.waypoints = data.waypoints or {} for _, v in ipairs(data.waypoints) do - local id = player:hud_add { - hud_elem_type = "waypoint", - name = v.name, - text = " m", - world_pos = v.pos, - number = v.color, - z_index = -300, - } + if not v.hide then + local id = player:hud_add { + hud_elem_type = "waypoint", + name = v.name, + text = " m", + world_pos = v.pos, + number = v.color, + z_index = -300, + } - v.id = id - - if v.hide then - player:hud_remove(id) + v.id = id end end end