trying to make navigation maps more crash-tolerant
This commit is contained in:
parent
f1ecaee793
commit
94d87a9e92
|
@ -53,7 +53,10 @@ local function get_formspec_waypoint(x, y, name, label, isinfo)
|
||||||
end
|
end
|
||||||
|
|
||||||
function nav.show_map(player)
|
function nav.show_map(player)
|
||||||
|
if player == nil then return end
|
||||||
|
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
|
|
||||||
if not open_formspecs[name] then return end
|
if not open_formspecs[name] then return end
|
||||||
|
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
|
@ -117,12 +120,14 @@ local function step(dtime)
|
||||||
local players = {}
|
local players = {}
|
||||||
|
|
||||||
for _, player in pairs(minetest.get_connected_players()) do
|
for _, player in pairs(minetest.get_connected_players()) do
|
||||||
|
if player ~= nil then
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
|
|
||||||
players[name] = player
|
players[name] = player
|
||||||
|
|
||||||
nav.show_map(player)
|
nav.show_map(player)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
for wptname, wpt in pairs(nav.waypoints) do
|
for wptname, wpt in pairs(nav.waypoints) do
|
||||||
if wpt.type == "player" then
|
if wpt.type == "player" then
|
||||||
|
|
Loading…
Reference in New Issue