Revert "Fix possible hud vector error"

This was fixed upstream in builtin.
This reverts commit 1a8efa9916.
This commit is contained in:
ShadowNinja 2013-11-18 21:04:14 -05:00
parent f096fb4dbb
commit 38dc65eb8e

49
hud.lua
View File

@ -5,32 +5,29 @@ areas.hud = {}
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
for _, player in pairs(minetest.get_connected_players()) do for _, player in pairs(minetest.get_connected_players()) do
local name = player:get_player_name() local name = player:get_player_name()
local pos = player:getpos() local pos = vector.round(player:getpos())
if pos then local owners = areas:getNodeOwners(pos)
pos = vector.round(pos) local ownerString = table.concat(owners, ", ")
local owners = areas:getNodeOwners(pos) if not areas.hud[name] then
local ownerString = table.concat(owners, ", ") areas.hud[name] = {}
if not areas.hud[name] then areas.hud[name].ownersId = player:hud_add({
areas.hud[name] = {} hud_elem_type = "text",
areas.hud[name].ownersId = player:hud_add({ name = "AreaOwners",
hud_elem_type = "text", number = 0xFFFFFF,
name = "AreaOwners", position = {x=0, y=1},
number = 0xFFFFFF, offset = {x=5, y=-40},
position = {x=0, y=1}, direction = 0,
offset = {x=5, y=-40}, text = "Area owners: "..ownerString,
direction = 0, scale = {x=200, y=40},
text = "Area owners: "..ownerString, alignment = {x=1, y=1},
scale = {x=200, y=40}, })
alignment = {x=1, y=1}, areas.hud[name].oldOwners = ownerString
}) return
areas.hud[name].oldOwners = ownerString end
return if areas.hud[name].oldOwners ~= ownerString then
end player:hud_change(areas.hud[name].ownersId, "text",
if areas.hud[name].oldOwners ~= ownerString then "Area owners: "..ownerString)
player:hud_change(areas.hud[name].ownersId, "text", areas.hud[name].oldOwners = ownerString
"Area owners: "..ownerString)
areas.hud[name].oldOwners = ownerString
end
end end
end end
end) end)