fixed a bug in maps
This commit is contained in:
parent
f602cb022f
commit
59f374f38f
@ -20,6 +20,10 @@ function nav.remove_waypoint(name)
|
|||||||
nav.waypoints[name] = nil
|
nav.waypoints[name] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function nav.relocate_waypoint(name, pos)
|
||||||
|
nav.waypoints[name].pos = pos
|
||||||
|
end
|
||||||
|
|
||||||
function nav.get_waypoints_in_square(pos, radius)
|
function nav.get_waypoints_in_square(pos, radius)
|
||||||
local wpts = {}
|
local wpts = {}
|
||||||
|
|
||||||
@ -122,7 +126,9 @@ local function step(dtime)
|
|||||||
|
|
||||||
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
|
||||||
wpt.pos = players[wpt.label]:getpos()
|
if players[wpt.label] ~= nil and minetest.get_player_by_name(wpt.label) ~= nil then
|
||||||
|
nav.relocate_waypoint(wptname, players[wpt.label:]getpos())
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user