Fix possible hud vector error

This commit is contained in:
ShadowNinja 2013-11-14 18:25:47 -05:00
parent 7bfe20661d
commit 1a8efa9916

View File

@ -5,7 +5,9 @@ areas.hud = {}
minetest.register_globalstep(function(dtime)
for _, player in pairs(minetest.get_connected_players()) do
local name = player:get_player_name()
local pos = vector.round(player:getpos())
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
@ -30,6 +32,7 @@ minetest.register_globalstep(function(dtime)
areas.hud[name].oldOwners = ownerString
end
end
end
end)
minetest.register_on_leaveplayer(function(player)