diff options
author | RealBadAngel <maciej.kasatkin@o2.pl> | 2014-05-26 11:43:25 +0200 |
---|---|---|
committer | RealBadAngel <maciej.kasatkin@o2.pl> | 2014-05-26 11:43:25 +0200 |
commit | 833a255ad46420807d5baf72c52933471fd24cf1 (patch) | |
tree | 660237a38d36172cd9cd6fce20471582c3cd9106 | |
parent | b46f4217aee762c5b8c7ceb0f2a2332227c4a7f8 (diff) |
Some fixes to item_names and waypoints.
-rw-r--r-- | item_names.lua | 4 | ||||
-rw-r--r-- | waypoints.lua | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/item_names.lua b/item_names.lua index 2ab233e..31c2b3f 100644 --- a/item_names.lua +++ b/item_names.lua @@ -1,3 +1,5 @@ +-- code based on 4itemnames mod by 4aiman + local wield = {} local huds = {} local dtimes = {} @@ -27,7 +29,7 @@ minetest.register_on_joinplayer(function(player) number = 0xFFFFFF , text = "", }) - print(dump("item hud id: "..huds[player_name])) + --print(dump("item hud id: "..huds[player_name])) end) end) diff --git a/waypoints.lua b/waypoints.lua index d4f81a5..55e91a4 100644 --- a/waypoints.lua +++ b/waypoints.lua @@ -96,8 +96,10 @@ unified_inventory.update_hud = function (player, waypoint) else name = waypoint.name end - if waypoint.active then + if waypoint.hud then player:hud_remove(waypoint.hud) + end + if waypoint.active then waypoint.hud = player:hud_add({ hud_elem_type = "waypoint", number = unified_inventory.hud_colors[waypoint.color][2] , @@ -106,10 +108,7 @@ unified_inventory.update_hud = function (player, waypoint) world_pos = waypoint.world_pos }) else - if waypoint.hud ~= nil then - player:hud_remove(waypoint.hud) - waypoint.hud = nil - end + waypoint.hud = nil end end |