diff options
author | ShadowNinja <shadowninja@minetest.net> | 2013-11-18 21:04:14 -0500 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2013-11-18 21:12:27 -0500 |
commit | 38dc65eb8e5bd2df6cd52b5122d517f8beffdef3 (patch) | |
tree | e1d860bb7c4ed6ddd2e68f8743e59b8e42e3e3ad /hud.lua | |
parent | f096fb4dbbfae72d4669f6ea3a25823c16e2934d (diff) |
Revert "Fix possible hud vector error"
This was fixed upstream in builtin.
This reverts commit 1a8efa991661485b32b0c337e1fd1f43506cf16b.
Diffstat (limited to 'hud.lua')
-rw-r--r-- | hud.lua | 49 |
1 files changed, 23 insertions, 26 deletions
@@ -5,32 +5,29 @@ areas.hud = {} minetest.register_globalstep(function(dtime) for _, player in pairs(minetest.get_connected_players()) do local name = player:get_player_name() - local pos = player:getpos() - if pos then - pos = vector.round(pos) - local owners = areas:getNodeOwners(pos) - local ownerString = table.concat(owners, ", ") - if not areas.hud[name] then - areas.hud[name] = {} - areas.hud[name].ownersId = player:hud_add({ - hud_elem_type = "text", - name = "AreaOwners", - number = 0xFFFFFF, - position = {x=0, y=1}, - offset = {x=5, y=-40}, - direction = 0, - text = "Area owners: "..ownerString, - scale = {x=200, y=40}, - alignment = {x=1, y=1}, - }) - areas.hud[name].oldOwners = ownerString - return - end - if areas.hud[name].oldOwners ~= ownerString then - player:hud_change(areas.hud[name].ownersId, "text", - "Area owners: "..ownerString) - areas.hud[name].oldOwners = ownerString - end + local pos = vector.round(player:getpos()) + local owners = areas:getNodeOwners(pos) + local ownerString = table.concat(owners, ", ") + if not areas.hud[name] then + areas.hud[name] = {} + areas.hud[name].ownersId = player:hud_add({ + hud_elem_type = "text", + name = "AreaOwners", + number = 0xFFFFFF, + position = {x=0, y=1}, + offset = {x=5, y=-40}, + direction = 0, + text = "Area owners: "..ownerString, + scale = {x=200, y=40}, + alignment = {x=1, y=1}, + }) + areas.hud[name].oldOwners = ownerString + return + end + if areas.hud[name].oldOwners ~= ownerString then + player:hud_change(areas.hud[name].ownersId, "text", + "Area owners: "..ownerString) + areas.hud[name].oldOwners = ownerString end end end) |